diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-06-03 20:53:59 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-06-06 18:50:40 +0300 |
commit | 206c4c4d337fc687bda03e052813f06e7d199a6d (patch) | |
tree | 661932375a7d2d346c130f7b7529c062ba612552 /fs/ubifs | |
parent | 6475613cb4fb21b628c3e74f8aa188c74416d513 (diff) |
UBIFS: remove format version 2 support
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/key.h | 37 | ||||
-rw-r--r-- | fs/ubifs/sb.c | 8 | ||||
-rw-r--r-- | fs/ubifs/ubifs-media.h | 8 |
3 files changed, 5 insertions, 48 deletions
diff --git a/fs/ubifs/key.h b/fs/ubifs/key.h index 5a919d0ad853..2711326d14ab 100644 --- a/fs/ubifs/key.h +++ b/fs/ubifs/key.h @@ -54,9 +54,7 @@ static inline uint32_t key_r5_hash(const char *s, int len) str++; } - /* TODO: change this to - * a &= UBIFS_S_KEY_HASH_MASK; */ - a &= 0x1FFFFFFF; + a &= UBIFS_S_KEY_HASH_MASK; /* * We use hash values as offset in directories, so values %0 and %1 are @@ -69,35 +67,6 @@ static inline uint32_t key_r5_hash(const char *s, int len) } /** - * tmp_key_r5_hash - R5 hash function (borrowed from reiserfs). - * @s: direntry name - * @len: name length - * TODO: this should die soon - */ -static inline uint32_t tmp_key_r5_hash(const char *s, int len) -{ - uint32_t a = 0; - const signed char *str = (const signed char *)s; - - while (*str) { - a += *str << 4; - a += *str >> 4; - a *= 11; - str++; - } - - a &= 0x01FFFFFF; - - /* - * We use hash values as offset in directories, so values %0 and %1 are - * reserved for "." and "..". %2 is reserved for possible future use. - */ - if (unlikely(a >= 0 && a <= 2)) - a += 3; - return a; -} - -/** * key_test_hash - testing hash function. * @str: direntry name * @len: name length @@ -108,9 +77,7 @@ static inline uint32_t key_test_hash(const char *str, int len) len = min_t(uint32_t, len, 4); memcpy(&a, str, len); - /* TODO: change this to - * a &= UBIFS_S_KEY_HASH_MASK; */ - a &= 0x1FFFFFFF; + a &= UBIFS_S_KEY_HASH_MASK; if (unlikely(a >= 0 && a <= 2)) a += 3; return a; diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 2c06ffd76d02..a02c2200d0c3 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -527,7 +527,7 @@ int ubifs_read_superblock(struct ubifs_info *c) goto out; } - if (c->fmt_version == 1) { + if (c->fmt_version < 3) { ubifs_err("on-flash format version %d is not supported", c->fmt_version); err = -EINVAL; @@ -536,11 +536,7 @@ int ubifs_read_superblock(struct ubifs_info *c) switch (sup->key_hash) { case UBIFS_KEY_HASH_R5: - /* TODO: this should die soon */ - if (c->fmt_version == 2) - c->key_hash = tmp_key_r5_hash; - else - c->key_hash = key_r5_hash; + c->key_hash = key_r5_hash; c->key_hash_type = UBIFS_KEY_HASH_R5; break; diff --git a/fs/ubifs/ubifs-media.h b/fs/ubifs/ubifs-media.h index 41c347dc0945..460378d93036 100644 --- a/fs/ubifs/ubifs-media.h +++ b/fs/ubifs/ubifs-media.h @@ -174,13 +174,7 @@ enum { * value. */ #define UBIFS_S_KEY_BLOCK_BITS 29 -/* - * TODO: this is a temporary hach which was added to support old format and to - * avoid breaking binary compatibility. It is temporaty and should go. The - * define should be - * #define UBIFS_S_KEY_BLOCK_MASK 0x1FFFFFFF - */ -#define UBIFS_S_KEY_BLOCK_MASK (c->fmt_version == 2 ? 0x01FFFFFF : 0x1FFFFFFF) +#define UBIFS_S_KEY_BLOCK_MASK 0x1FFFFFFF #define UBIFS_S_KEY_HASH_BITS UBIFS_S_KEY_BLOCK_BITS #define UBIFS_S_KEY_HASH_MASK UBIFS_S_KEY_BLOCK_MASK |