vfs: make the string hashes salt the hash
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Jun 2016 14:51:30 +0000 (07:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Jun 2016 03:21:46 +0000 (20:21 -0700)
commit8387ff2577eb9ed245df9a39947f66976c6bcd02
tree79fafcb5777f16e520d1c39e9389039f866b4c6d
parent147d9e7bcad3b8d5465f6eea6292731e7f35dee8
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@oracle.com>
Cc: George Spelvin <linux@sciencehorizons.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
38 files changed:
drivers/staging/lustre/lustre/llite/statahead.c
fs/adfs/dir.c
fs/affs/namei.c
fs/autofs4/waitq.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/cifs/dir.c
fs/dcache.c
fs/efivarfs/super.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/hfs/string.c
fs/hfsplus/unicode.c
fs/hpfs/dentry.c
fs/isofs/inode.c
fs/jffs2/dir.c
fs/jffs2/readinode.c
fs/jffs2/scan.c
fs/jffs2/summary.c
fs/jffs2/write.c
fs/jfs/namei.c
fs/kernfs/dir.c
fs/namei.c
fs/ncpfs/dir.c
fs/nfs/dir.c
fs/ntfs/namei.c
fs/ocfs2/dlm/dlmcommon.h
fs/proc/proc_sysctl.c
fs/sysv/namei.c
include/linux/stringhash.h
include/linux/sunrpc/svcauth.h
lib/test_hash.c
net/core/dev.c
security/smack/smack_access.c
security/tomoyo/memory.c
security/tomoyo/util.c