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/dir-rtems.c

    rfb5bc64d r0ec9bbc  
    3131        struct jffs2_full_dirent *fd = NULL, *fd_list;
    3232        uint32_t ino = 0;
    33         uint32_t hash = full_name_hash(name, namelen);
     33        uint32_t hash = full_name_hash(NULL, name, namelen);
    3434        struct _inode *inode = NULL;
    3535
Note: See TracChangeset for help on using the changeset viewer.