Ignore:
Timestamp:
Jun 10, 2016, 2:51:30 PM (3 years ago)
Author:
Linus Torvalds <torvalds@…>
Branches:
master
Children:
976af92
Parents:
fb5bc64d
git-author:
Linus Torvalds <torvalds@…> (06/10/16 14:51:30)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/16/18 05:22:13)
Message:

vfs: make the string hashes salt the hash

We always mixed in the parent pointer into the dentry name hash, but we
did it late at lookup time. It turns out that we can simplify that
lookup-time action by salting the hash with the parent pointer early
instead of late.

A few other users of our string hashes also wanted to mix in their own
pointers into the hash, and those are updated to use the same mechanism.

Hash users that don't have any particular initial salt can just use the
NULL pointer as a no-salt.

Cc: Vegard Nossum <vegard.nossum@…>
Cc: George Spelvin <linux@…>
Cc: Al Viro <viro@…>
Signed-off-by: Linus Torvalds <torvalds@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/jffs2/src/scan.c

    rfb5bc64d r0ec9bbc  
    11041104        fd->version = je32_to_cpu(rd->version);
    11051105        fd->ino = je32_to_cpu(rd->ino);
    1106         fd->nhash = full_name_hash(fd->name, checkedlen);
     1106        fd->nhash = full_name_hash(NULL, fd->name, checkedlen);
    11071107        fd->type = rd->type;
    11081108        jffs2_add_fd_to_list(c, fd, &ic->scan_dents);
Note: See TracChangeset for help on using the changeset viewer.