diff options
author | Richard Weinberger <richard@nod.at> | 2016-11-11 20:46:06 +0100 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2016-12-12 23:07:38 +0100 |
commit | 528e3d178f257e36001345d4d61ae5af35422017 (patch) | |
tree | 6ad691850c8ab01965cc3b556b746b1828efb002 /fs/ubifs/journal.c | |
parent | ubifs: Rename tnc_read_node_nm (diff) | |
download | linux-528e3d178f257e36001345d4d61ae5af35422017.tar.xz linux-528e3d178f257e36001345d4d61ae5af35422017.zip |
ubifs: Add full hash lookup support
UBIFS stores a 32bit hash of every file, for traditional lookups by name
this scheme is fine since UBIFS can first try to find the file by the
hash of the filename and upon collisions it can walk through all entries
with the same hash and do a string compare.
When filesnames are encrypted fscrypto will ask the filesystem for a
unique cookie, based on this cookie the filesystem has to be able to
locate the target file again. With 32bit hashes this is impossible
because the chance for collisions is very high. Do deal with that we
store a 32bit cookie directly in the UBIFS directory entry node such
that we get a 64bit cookie (32bit from filename hash and the dent
cookie). For a lookup by hash UBIFS finds the entry by the first 32bit
and then compares the dent cookie. If it does not match, it has to do a
linear search of the whole directory and compares all dent cookies until
the correct entry is found.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/journal.c')
-rw-r--r-- | fs/ubifs/journal.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index f2b989dbe25a..0698cccc6223 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -78,7 +78,6 @@ static inline void zero_ino_node_unused(struct ubifs_ino_node *ino) static inline void zero_dent_node_unused(struct ubifs_dent_node *dent) { dent->padding1 = 0; - memset(dent->padding2, 0, 4); } /** |