summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-06-10 10:51:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-06-10 23:21:46 -0400
commit8387ff2577eb9ed245df9a39947f66976c6bcd02 (patch)
tree79fafcb5777f16e520d1c39e9389039f866b4c6d /fs
parent147d9e7bcad3b8d5465f6eea6292731e7f35dee8 (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/adfs/dir.c2
-rw-r--r--fs/affs/namei.c8
-rw-r--r--fs/autofs4/waitq.c2
-rw-r--r--fs/ceph/inode.c4
-rw-r--r--fs/ceph/mds_client.c2
-rw-r--r--fs/cifs/dir.c2
-rw-r--r--fs/dcache.c21
-rw-r--r--fs/efivarfs/super.c4
-rw-r--r--fs/fat/namei_msdos.c2
-rw-r--r--fs/fat/namei_vfat.c4
-rw-r--r--fs/fuse/dev.c2
-rw-r--r--fs/fuse/dir.c3
-rw-r--r--fs/hfs/string.c2
-rw-r--r--fs/hfsplus/unicode.c2
-rw-r--r--fs/hpfs/dentry.c2
-rw-r--r--fs/isofs/inode.c14
-rw-r--r--fs/jffs2/dir.c8
-rw-r--r--fs/jffs2/readinode.c2
-rw-r--r--fs/jffs2/scan.c2
-rw-r--r--fs/jffs2/summary.c2
-rw-r--r--fs/jffs2/write.c4
-rw-r--r--fs/jfs/namei.c2
-rw-r--r--fs/kernfs/dir.c4
-rw-r--r--fs/namei.c42
-rw-r--r--fs/ncpfs/dir.c2
-rw-r--r--fs/nfs/dir.c4
-rw-r--r--fs/ntfs/namei.c2
-rw-r--r--fs/ocfs2/dlm/dlmcommon.h2
-rw-r--r--fs/proc/proc_sysctl.c2
-rw-r--r--fs/sysv/namei.c2
30 files changed, 82 insertions, 74 deletions
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index fd4cf2c48e48..bec25f7017c0 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -207,7 +207,7 @@ adfs_hash(const struct dentry *parent, struct qstr *qstr)
207 */ 207 */
208 qstr->len = i = name_len; 208 qstr->len = i = name_len;
209 name = qstr->name; 209 name = qstr->name;
210 hash = init_name_hash(); 210 hash = init_name_hash(parent);
211 while (i--) { 211 while (i--) {
212 char c; 212 char c;
213 213
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index 00d3002a6780..eb32029bc776 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -61,7 +61,7 @@ affs_get_toupper(struct super_block *sb)
61 * Note: the dentry argument is the parent dentry. 61 * Note: the dentry argument is the parent dentry.
62 */ 62 */
63static inline int 63static inline int
64__affs_hash_dentry(struct qstr *qstr, toupper_t toupper, bool notruncate) 64__affs_hash_dentry(const struct dentry *dentry, struct qstr *qstr, toupper_t toupper, bool notruncate)
65{ 65{
66 const u8 *name = qstr->name; 66 const u8 *name = qstr->name;
67 unsigned long hash; 67 unsigned long hash;
@@ -72,7 +72,7 @@ __affs_hash_dentry(struct qstr *qstr, toupper_t toupper, bool notruncate)
72 if (retval) 72 if (retval)
73 return retval; 73 return retval;
74 74
75 hash = init_name_hash(); 75 hash = init_name_hash(dentry);
76 len = min(qstr->len, AFFSNAMEMAX); 76 len = min(qstr->len, AFFSNAMEMAX);
77 for (; len > 0; name++, len--) 77 for (; len > 0; name++, len--)
78 hash = partial_name_hash(toupper(*name), hash); 78 hash = partial_name_hash(toupper(*name), hash);
@@ -84,7 +84,7 @@ __affs_hash_dentry(struct qstr *qstr, toupper_t toupper, bool notruncate)
84static int 84static int
85affs_hash_dentry(const struct dentry *dentry, struct qstr *qstr) 85affs_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
86{ 86{
87 return __affs_hash_dentry(qstr, affs_toupper, 87 return __affs_hash_dentry(dentry, qstr, affs_toupper,
88 affs_nofilenametruncate(dentry)); 88 affs_nofilenametruncate(dentry));
89 89
90} 90}
@@ -92,7 +92,7 @@ affs_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
92static int 92static int
93affs_intl_hash_dentry(const struct dentry *dentry, struct qstr *qstr) 93affs_intl_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
94{ 94{
95 return __affs_hash_dentry(qstr, affs_intl_toupper, 95 return __affs_hash_dentry(dentry, qstr, affs_intl_toupper,
96 affs_nofilenametruncate(dentry)); 96 affs_nofilenametruncate(dentry));
97 97
98} 98}
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 0146d911f468..f620160ceb6c 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -397,7 +397,7 @@ int autofs4_wait(struct autofs_sb_info *sbi,
397 } 397 }
398 } 398 }
399 qstr.name = name; 399 qstr.name = name;
400 qstr.hash = full_name_hash(name, qstr.len); 400 qstr.hash = full_name_hash(dentry, name, qstr.len);
401 401
402 if (mutex_lock_interruptible(&sbi->wq_mutex)) { 402 if (mutex_lock_interruptible(&sbi->wq_mutex)) {
403 kfree(qstr.name); 403 kfree(qstr.name);
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index f059b5997072..99bdef66213a 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1164,7 +1164,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
1164 1164
1165 dname.name = rinfo->dname; 1165 dname.name = rinfo->dname;
1166 dname.len = rinfo->dname_len; 1166 dname.len = rinfo->dname_len;
1167 dname.hash = full_name_hash(dname.name, dname.len); 1167 dname.hash = full_name_hash(parent, dname.name, dname.len);
1168 vino.ino = le64_to_cpu(rinfo->targeti.in->ino); 1168 vino.ino = le64_to_cpu(rinfo->targeti.in->ino);
1169 vino.snap = le64_to_cpu(rinfo->targeti.in->snapid); 1169 vino.snap = le64_to_cpu(rinfo->targeti.in->snapid);
1170retry_lookup: 1170retry_lookup:
@@ -1508,7 +1508,7 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
1508 1508
1509 dname.name = rde->name; 1509 dname.name = rde->name;
1510 dname.len = rde->name_len; 1510 dname.len = rde->name_len;
1511 dname.hash = full_name_hash(dname.name, dname.len); 1511 dname.hash = full_name_hash(parent, dname.name, dname.len);
1512 1512
1513 vino.ino = le64_to_cpu(rde->inode.in->ino); 1513 vino.ino = le64_to_cpu(rde->inode.in->ino);
1514 vino.snap = le64_to_cpu(rde->inode.in->snapid); 1514 vino.snap = le64_to_cpu(rde->inode.in->snapid);
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 2103b823bec0..4e8678a612b6 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -3204,7 +3204,7 @@ static void handle_lease(struct ceph_mds_client *mdsc,
3204 WARN_ON(1); 3204 WARN_ON(1);
3205 goto release; /* hrm... */ 3205 goto release; /* hrm... */
3206 } 3206 }
3207 dname.hash = full_name_hash(dname.name, dname.len); 3207 dname.hash = full_name_hash(parent, dname.name, dname.len);
3208 dentry = d_lookup(parent, &dname); 3208 dentry = d_lookup(parent, &dname);
3209 dput(parent); 3209 dput(parent);
3210 if (!dentry) 3210 if (!dentry)
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index c3eb998a99bd..916b2d7d3a9b 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -856,7 +856,7 @@ static int cifs_ci_hash(const struct dentry *dentry, struct qstr *q)
856 wchar_t c; 856 wchar_t c;
857 int i, charlen; 857 int i, charlen;
858 858
859 hash = init_name_hash(); 859 hash = init_name_hash(dentry);
860 for (i = 0; i < q->len; i += charlen) { 860 for (i = 0; i < q->len; i += charlen) {
861 charlen = codepage->char2uni(&q->name[i], q->len - i, &c); 861 charlen = codepage->char2uni(&q->name[i], q->len - i, &c);
862 /* error out if we can't convert the character */ 862 /* error out if we can't convert the character */
diff --git a/fs/dcache.c b/fs/dcache.c
index 817c243c1ff1..9522b8b63871 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -104,10 +104,8 @@ static unsigned int d_hash_shift __read_mostly;
104 104
105static struct hlist_bl_head *dentry_hashtable __read_mostly; 105static struct hlist_bl_head *dentry_hashtable __read_mostly;
106 106
107static inline struct hlist_bl_head *d_hash(const struct dentry *parent, 107static inline struct hlist_bl_head *d_hash(unsigned int hash)
108 unsigned int hash)
109{ 108{
110 hash += (unsigned long) parent / L1_CACHE_BYTES;
111 return dentry_hashtable + hash_32(hash, d_hash_shift); 109 return dentry_hashtable + hash_32(hash, d_hash_shift);
112} 110}
113 111
@@ -488,7 +486,7 @@ void __d_drop(struct dentry *dentry)
488 if (unlikely(IS_ROOT(dentry))) 486 if (unlikely(IS_ROOT(dentry)))
489 b = &dentry->d_sb->s_anon; 487 b = &dentry->d_sb->s_anon;
490 else 488 else
491 b = d_hash(dentry->d_parent, dentry->d_name.hash); 489 b = d_hash(dentry->d_name.hash);
492 490
493 hlist_bl_lock(b); 491 hlist_bl_lock(b);
494 __hlist_bl_del(&dentry->d_hash); 492 __hlist_bl_del(&dentry->d_hash);
@@ -1670,7 +1668,7 @@ struct dentry *d_alloc_name(struct dentry *parent, const char *name)
1670 struct qstr q; 1668 struct qstr q;
1671 1669
1672 q.name = name; 1670 q.name = name;
1673 q.hash_len = hashlen_string(name); 1671 q.hash_len = hashlen_string(parent, name);
1674 return d_alloc(parent, &q); 1672 return d_alloc(parent, &q);
1675} 1673}
1676EXPORT_SYMBOL(d_alloc_name); 1674EXPORT_SYMBOL(d_alloc_name);
@@ -2094,7 +2092,7 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent,
2094{ 2092{
2095 u64 hashlen = name->hash_len; 2093 u64 hashlen = name->hash_len;
2096 const unsigned char *str = name->name; 2094 const unsigned char *str = name->name;
2097 struct hlist_bl_head *b = d_hash(parent, hashlen_hash(hashlen)); 2095 struct hlist_bl_head *b = d_hash(hashlen_hash(hashlen));
2098 struct hlist_bl_node *node; 2096 struct hlist_bl_node *node;
2099 struct dentry *dentry; 2097 struct dentry *dentry;
2100 2098
@@ -2211,7 +2209,7 @@ struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name)
2211 unsigned int len = name->len; 2209 unsigned int len = name->len;
2212 unsigned int hash = name->hash; 2210 unsigned int hash = name->hash;
2213 const unsigned char *str = name->name; 2211 const unsigned char *str = name->name;
2214 struct hlist_bl_head *b = d_hash(parent, hash); 2212 struct hlist_bl_head *b = d_hash(hash);
2215 struct hlist_bl_node *node; 2213 struct hlist_bl_node *node;
2216 struct dentry *found = NULL; 2214 struct dentry *found = NULL;
2217 struct dentry *dentry; 2215 struct dentry *dentry;
@@ -2291,7 +2289,7 @@ struct dentry *d_hash_and_lookup(struct dentry *dir, struct qstr *name)
2291 * calculate the standard hash first, as the d_op->d_hash() 2289 * calculate the standard hash first, as the d_op->d_hash()
2292 * routine may choose to leave the hash value unchanged. 2290 * routine may choose to leave the hash value unchanged.
2293 */ 2291 */
2294 name->hash = full_name_hash(name->name, name->len); 2292 name->hash = full_name_hash(dir, name->name, name->len);
2295 if (dir->d_flags & DCACHE_OP_HASH) { 2293 if (dir->d_flags & DCACHE_OP_HASH) {
2296 int err = dir->d_op->d_hash(dir, name); 2294 int err = dir->d_op->d_hash(dir, name);
2297 if (unlikely(err < 0)) 2295 if (unlikely(err < 0))
@@ -2364,7 +2362,7 @@ static void __d_rehash(struct dentry * entry, struct hlist_bl_head *b)
2364 2362
2365static void _d_rehash(struct dentry * entry) 2363static void _d_rehash(struct dentry * entry)
2366{ 2364{
2367 __d_rehash(entry, d_hash(entry->d_parent, entry->d_name.hash)); 2365 __d_rehash(entry, d_hash(entry->d_name.hash));
2368} 2366}
2369 2367
2370/** 2368/**
@@ -2821,7 +2819,7 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
2821 * for the same hash queue because of how unlikely it is. 2819 * for the same hash queue because of how unlikely it is.
2822 */ 2820 */
2823 __d_drop(dentry); 2821 __d_drop(dentry);
2824 __d_rehash(dentry, d_hash(target->d_parent, target->d_name.hash)); 2822 __d_rehash(dentry, d_hash(target->d_name.hash));
2825 2823
2826 /* 2824 /*
2827 * Unhash the target (d_delete() is not usable here). If exchanging 2825 * Unhash the target (d_delete() is not usable here). If exchanging
@@ -2829,8 +2827,7 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
2829 */ 2827 */
2830 __d_drop(target); 2828 __d_drop(target);
2831 if (exchange) { 2829 if (exchange) {
2832 __d_rehash(target, 2830 __d_rehash(target, d_hash(dentry->d_name.hash));
2833 d_hash(dentry->d_parent, dentry->d_name.hash));
2834 } 2831 }
2835 2832
2836 /* Switch the names.. */ 2833 /* Switch the names.. */
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 9cb54a38832d..a5e607e8f056 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -65,7 +65,7 @@ static int efivarfs_d_compare(const struct dentry *parent,
65 65
66static int efivarfs_d_hash(const struct dentry *dentry, struct qstr *qstr) 66static int efivarfs_d_hash(const struct dentry *dentry, struct qstr *qstr)
67{ 67{
68 unsigned long hash = init_name_hash(); 68 unsigned long hash = init_name_hash(dentry);
69 const unsigned char *s = qstr->name; 69 const unsigned char *s = qstr->name;
70 unsigned int len = qstr->len; 70 unsigned int len = qstr->len;
71 71
@@ -98,7 +98,7 @@ static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name)
98 q.name = name; 98 q.name = name;
99 q.len = strlen(name); 99 q.len = strlen(name);
100 100
101 err = efivarfs_d_hash(NULL, &q); 101 err = efivarfs_d_hash(parent, &q);
102 if (err) 102 if (err)
103 return ERR_PTR(err); 103 return ERR_PTR(err);
104 104
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index b7e2b33aa793..1337c0c7527d 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -154,7 +154,7 @@ static int msdos_hash(const struct dentry *dentry, struct qstr *qstr)
154 154
155 error = msdos_format_name(qstr->name, qstr->len, msdos_name, options); 155 error = msdos_format_name(qstr->name, qstr->len, msdos_name, options);
156 if (!error) 156 if (!error)
157 qstr->hash = full_name_hash(msdos_name, MSDOS_NAME); 157 qstr->hash = full_name_hash(dentry, msdos_name, MSDOS_NAME);
158 return 0; 158 return 0;
159} 159}
160 160
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 7092584f424a..6ccdf3f34f90 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -107,7 +107,7 @@ static unsigned int vfat_striptail_len(const struct qstr *qstr)
107 */ 107 */
108static int vfat_hash(const struct dentry *dentry, struct qstr *qstr) 108static int vfat_hash(const struct dentry *dentry, struct qstr *qstr)
109{ 109{
110 qstr->hash = full_name_hash(qstr->name, vfat_striptail_len(qstr)); 110 qstr->hash = full_name_hash(dentry, qstr->name, vfat_striptail_len(qstr));
111 return 0; 111 return 0;
112} 112}
113 113
@@ -127,7 +127,7 @@ static int vfat_hashi(const struct dentry *dentry, struct qstr *qstr)
127 name = qstr->name; 127 name = qstr->name;
128 len = vfat_striptail_len(qstr); 128 len = vfat_striptail_len(qstr);
129 129
130 hash = init_name_hash(); 130 hash = init_name_hash(dentry);
131 while (len--) 131 while (len--)
132 hash = partial_name_hash(nls_tolower(t, *name++), hash); 132 hash = partial_name_hash(nls_tolower(t, *name++), hash);
133 qstr->hash = end_name_hash(hash); 133 qstr->hash = end_name_hash(hash);
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index cbece1221417..203adf3b75db 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1525,7 +1525,6 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
1525 goto err; 1525 goto err;
1526 fuse_copy_finish(cs); 1526 fuse_copy_finish(cs);
1527 buf[outarg.namelen] = 0; 1527 buf[outarg.namelen] = 0;
1528 name.hash = full_name_hash(name.name, name.len);
1529 1528
1530 down_read(&fc->killsb); 1529 down_read(&fc->killsb);
1531 err = -ENOENT; 1530 err = -ENOENT;
@@ -1576,7 +1575,6 @@ static int fuse_notify_delete(struct fuse_conn *fc, unsigned int size,
1576 goto err; 1575 goto err;
1577 fuse_copy_finish(cs); 1576 fuse_copy_finish(cs);
1578 buf[outarg.namelen] = 0; 1577 buf[outarg.namelen] = 0;
1579 name.hash = full_name_hash(name.name, name.len);
1580 1578
1581 down_read(&fc->killsb); 1579 down_read(&fc->killsb);
1582 err = -ENOENT; 1580 err = -ENOENT;
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index ccd4971cc6c1..112ab4068115 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -953,6 +953,7 @@ int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
953 if (!dir) 953 if (!dir)
954 goto unlock; 954 goto unlock;
955 955
956 name->hash = full_name_hash(dir, name->name, name->len);
956 entry = d_lookup(dir, name); 957 entry = d_lookup(dir, name);
957 dput(dir); 958 dput(dir);
958 if (!entry) 959 if (!entry)
@@ -1202,7 +1203,7 @@ static int fuse_direntplus_link(struct file *file,
1202 1203
1203 fc = get_fuse_conn(dir); 1204 fc = get_fuse_conn(dir);
1204 1205
1205 name.hash = full_name_hash(name.name, name.len); 1206 name.hash = full_name_hash(parent, name.name, name.len);
1206 dentry = d_lookup(parent, &name); 1207 dentry = d_lookup(parent, &name);
1207 if (!dentry) { 1208 if (!dentry) {
1208retry: 1209retry:
diff --git a/fs/hfs/string.c b/fs/hfs/string.c
index 85b610c3909f..ec9f164c35a5 100644
--- a/fs/hfs/string.c
+++ b/fs/hfs/string.c
@@ -59,7 +59,7 @@ int hfs_hash_dentry(const struct dentry *dentry, struct qstr *this)
59 if (len > HFS_NAMELEN) 59 if (len > HFS_NAMELEN)
60 len = HFS_NAMELEN; 60 len = HFS_NAMELEN;
61 61
62 hash = init_name_hash(); 62 hash = init_name_hash(dentry);
63 for (; len; len--) 63 for (; len; len--)
64 hash = partial_name_hash(caseorder[*name++], hash); 64 hash = partial_name_hash(caseorder[*name++], hash);
65 this->hash = end_name_hash(hash); 65 this->hash = end_name_hash(hash);
diff --git a/fs/hfsplus/unicode.c b/fs/hfsplus/unicode.c
index e8ef121a4d8b..c13c8a240be3 100644
--- a/fs/hfsplus/unicode.c
+++ b/fs/hfsplus/unicode.c
@@ -346,7 +346,7 @@ int hfsplus_hash_dentry(const struct dentry *dentry, struct qstr *str)
346 346
347 casefold = test_bit(HFSPLUS_SB_CASEFOLD, &HFSPLUS_SB(sb)->flags); 347 casefold = test_bit(HFSPLUS_SB_CASEFOLD, &HFSPLUS_SB(sb)->flags);
348 decompose = !test_bit(HFSPLUS_SB_NODECOMPOSE, &HFSPLUS_SB(sb)->flags); 348 decompose = !test_bit(HFSPLUS_SB_NODECOMPOSE, &HFSPLUS_SB(sb)->flags);
349 hash = init_name_hash(); 349 hash = init_name_hash(dentry);
350 astr = str->name; 350 astr = str->name;
351 len = str->len; 351 len = str->len;
352 while (len > 0) { 352 while (len > 0) {
diff --git a/fs/hpfs/dentry.c b/fs/hpfs/dentry.c
index fa27980f2229..60e6d334d79a 100644
--- a/fs/hpfs/dentry.c
+++ b/fs/hpfs/dentry.c
@@ -26,7 +26,7 @@ static int hpfs_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
26 /*return -ENOENT;*/ 26 /*return -ENOENT;*/
27 x: 27 x:
28 28
29 hash = init_name_hash(); 29 hash = init_name_hash(dentry);
30 for (i = 0; i < l; i++) 30 for (i = 0; i < l; i++)
31 hash = partial_name_hash(hpfs_upcase(hpfs_sb(dentry->d_sb)->sb_cp_table,qstr->name[i]), hash); 31 hash = partial_name_hash(hpfs_upcase(hpfs_sb(dentry->d_sb)->sb_cp_table,qstr->name[i]), hash);
32 qstr->hash = end_name_hash(hash); 32 qstr->hash = end_name_hash(hash);
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 131dedc920d8..761fade7680f 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -174,7 +174,7 @@ struct iso9660_options{
174 * Compute the hash for the isofs name corresponding to the dentry. 174 * Compute the hash for the isofs name corresponding to the dentry.
175 */ 175 */
176static int 176static int
177isofs_hashi_common(struct qstr *qstr, int ms) 177isofs_hashi_common(const struct dentry *dentry, struct qstr *qstr, int ms)
178{ 178{
179 const char *name; 179 const char *name;
180 int len; 180 int len;
@@ -188,7 +188,7 @@ isofs_hashi_common(struct qstr *qstr, int ms)
188 len--; 188 len--;
189 } 189 }
190 190
191 hash = init_name_hash(); 191 hash = init_name_hash(dentry);
192 while (len--) { 192 while (len--) {
193 c = tolower(*name++); 193 c = tolower(*name++);
194 hash = partial_name_hash(c, hash); 194 hash = partial_name_hash(c, hash);
@@ -231,7 +231,7 @@ static int isofs_dentry_cmp_common(
231static int 231static int
232isofs_hashi(const struct dentry *dentry, struct qstr *qstr) 232isofs_hashi(const struct dentry *dentry, struct qstr *qstr)
233{ 233{
234 return isofs_hashi_common(qstr, 0); 234 return isofs_hashi_common(dentry, qstr, 0);
235} 235}
236 236
237static int 237static int
@@ -246,7 +246,7 @@ isofs_dentry_cmpi(const struct dentry *parent, const struct dentry *dentry,
246 * Compute the hash for the isofs name corresponding to the dentry. 246 * Compute the hash for the isofs name corresponding to the dentry.
247 */ 247 */
248static int 248static int
249isofs_hash_common(struct qstr *qstr, int ms) 249isofs_hash_common(const struct dentry *dentry, struct qstr *qstr, int ms)
250{ 250{
251 const char *name; 251 const char *name;
252 int len; 252 int len;
@@ -258,7 +258,7 @@ isofs_hash_common(struct qstr *qstr, int ms)
258 len--; 258 len--;
259 } 259 }
260 260
261 qstr->hash = full_name_hash(name, len); 261 qstr->hash = full_name_hash(dentry, name, len);
262 262
263 return 0; 263 return 0;
264} 264}
@@ -266,13 +266,13 @@ isofs_hash_common(struct qstr *qstr, int ms)
266static int 266static int
267isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr) 267isofs_hash_ms(const struct dentry *dentry, struct qstr *qstr)
268{ 268{
269 return isofs_hash_common(qstr, 1); 269 return isofs_hash_common(dentry, qstr, 1);
270} 270}
271 271
272static int 272static int
273isofs_hashi_ms(const struct dentry *dentry, struct qstr *qstr) 273isofs_hashi_ms(const struct dentry *dentry, struct qstr *qstr)
274{ 274{
275 return isofs_hashi_common(qstr, 1); 275 return isofs_hashi_common(dentry, qstr, 1);
276} 276}
277 277
278static int 278static int
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index 84c4bf3631a2..30eb33ff8189 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -81,6 +81,7 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,
81 struct jffs2_full_dirent *fd = NULL, *fd_list; 81 struct jffs2_full_dirent *fd = NULL, *fd_list;
82 uint32_t ino = 0; 82 uint32_t ino = 0;
83 struct inode *inode = NULL; 83 struct inode *inode = NULL;
84 unsigned int nhash;
84 85
85 jffs2_dbg(1, "jffs2_lookup()\n"); 86 jffs2_dbg(1, "jffs2_lookup()\n");
86 87
@@ -89,11 +90,14 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,
89 90
90 dir_f = JFFS2_INODE_INFO(dir_i); 91 dir_f = JFFS2_INODE_INFO(dir_i);
91 92
93 /* The 'nhash' on the fd_list is not the same as the dentry hash */
94 nhash = full_name_hash(NULL, target->d_name.name, target->d_name.len);
95
92 mutex_lock(&dir_f->sem); 96 mutex_lock(&dir_f->sem);
93 97
94 /* NB: The 2.2 backport will need to explicitly check for '.' and '..' here */ 98 /* NB: The 2.2 backport will need to explicitly check for '.' and '..' here */
95 for (fd_list = dir_f->dents; fd_list && fd_list->nhash <= target->d_name.hash; fd_list = fd_list->next) { 99 for (fd_list = dir_f->dents; fd_list && fd_list->nhash <= nhash; fd_list = fd_list->next) {
96 if (fd_list->nhash == target->d_name.hash && 100 if (fd_list->nhash == nhash &&
97 (!fd || fd_list->version > fd->version) && 101 (!fd || fd_list->version > fd->version) &&
98 strlen(fd_list->name) == target->d_name.len && 102 strlen(fd_list->name) == target->d_name.len &&
99 !strncmp(fd_list->name, target->d_name.name, target->d_name.len)) { 103 !strncmp(fd_list->name, target->d_name.name, target->d_name.len)) {
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index bfebbf13698c..06a71dbd4833 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -674,7 +674,7 @@ static inline int read_direntry(struct jffs2_sb_info *c, struct jffs2_raw_node_r
674 } 674 }
675 } 675 }
676 676
677 fd->nhash = full_name_hash(fd->name, rd->nsize); 677 fd->nhash = full_name_hash(NULL, fd->name, rd->nsize);
678 fd->next = NULL; 678 fd->next = NULL;
679 fd->name[rd->nsize] = '\0'; 679 fd->name[rd->nsize] = '\0';
680 680
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 9ad5ba4b299b..90431dd613b8 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -1100,7 +1100,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
1100 fd->next = NULL; 1100 fd->next = NULL;
1101 fd->version = je32_to_cpu(rd->version); 1101 fd->version = je32_to_cpu(rd->version);
1102 fd->ino = je32_to_cpu(rd->ino); 1102 fd->ino = je32_to_cpu(rd->ino);
1103 fd->nhash = full_name_hash(fd->name, checkedlen); 1103 fd->nhash = full_name_hash(NULL, fd->name, checkedlen);
1104 fd->type = rd->type; 1104 fd->type = rd->type;
1105 jffs2_add_fd_to_list(c, fd, &ic->scan_dents); 1105 jffs2_add_fd_to_list(c, fd, &ic->scan_dents);
1106 1106
diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index bc5385471a6e..be7c8a6a5748 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -476,7 +476,7 @@ static int jffs2_sum_process_sum_data(struct jffs2_sb_info *c, struct jffs2_eras
476 fd->next = NULL; 476 fd->next = NULL;
477 fd->version = je32_to_cpu(spd->version); 477 fd->version = je32_to_cpu(spd->version);
478 fd->ino = je32_to_cpu(spd->ino); 478 fd->ino = je32_to_cpu(spd->ino);
479 fd->nhash = full_name_hash(fd->name, checkedlen); 479 fd->nhash = full_name_hash(NULL, fd->name, checkedlen);
480 fd->type = spd->type; 480 fd->type = spd->type;
481 481
482 jffs2_add_fd_to_list(c, fd, &ic->scan_dents); 482 jffs2_add_fd_to_list(c, fd, &ic->scan_dents);
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
index 7fb187ab2682..cda9a361368e 100644
--- a/fs/jffs2/write.c
+++ b/fs/jffs2/write.c
@@ -245,7 +245,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
245 245
246 fd->version = je32_to_cpu(rd->version); 246 fd->version = je32_to_cpu(rd->version);
247 fd->ino = je32_to_cpu(rd->ino); 247 fd->ino = je32_to_cpu(rd->ino);
248 fd->nhash = full_name_hash(name, namelen); 248 fd->nhash = full_name_hash(NULL, name, namelen);
249 fd->type = rd->type; 249 fd->type = rd->type;
250 memcpy(fd->name, name, namelen); 250 memcpy(fd->name, name, namelen);
251 fd->name[namelen]=0; 251 fd->name[namelen]=0;
@@ -598,7 +598,7 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
598 jffs2_add_fd_to_list(c, fd, &dir_f->dents); 598 jffs2_add_fd_to_list(c, fd, &dir_f->dents);
599 mutex_unlock(&dir_f->sem); 599 mutex_unlock(&dir_f->sem);
600 } else { 600 } else {
601 uint32_t nhash = full_name_hash(name, namelen); 601 uint32_t nhash = full_name_hash(NULL, name, namelen);
602 602
603 fd = dir_f->dents; 603 fd = dir_f->dents;
604 /* We don't actually want to reserve any space, but we do 604 /* We don't actually want to reserve any space, but we do
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 539deddecbb0..04baf0dfc40c 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1564,7 +1564,7 @@ static int jfs_ci_hash(const struct dentry *dir, struct qstr *this)
1564 unsigned long hash; 1564 unsigned long hash;
1565 int i; 1565 int i;
1566 1566
1567 hash = init_name_hash(); 1567 hash = init_name_hash(dir);
1568 for (i=0; i < this->len; i++) 1568 for (i=0; i < this->len; i++)
1569 hash = partial_name_hash(tolower(this->name[i]), hash); 1569 hash = partial_name_hash(tolower(this->name[i]), hash);
1570 this->hash = end_name_hash(hash); 1570 this->hash = end_name_hash(hash);
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 8a652404eef6..e57174d43683 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -336,11 +336,11 @@ struct kernfs_node *kernfs_get_parent(struct kernfs_node *kn)
336 */ 336 */
337static unsigned int kernfs_name_hash(const char *name, const void *ns) 337static unsigned int kernfs_name_hash(const char *name, const void *ns)
338{ 338{
339 unsigned long hash = init_name_hash(); 339 unsigned long hash = init_name_hash(ns);
340 unsigned int len = strlen(name); 340 unsigned int len = strlen(name);
341 while (len--) 341 while (len--)
342 hash = partial_name_hash(*name++, hash); 342 hash = partial_name_hash(*name++, hash);
343 hash = (end_name_hash(hash) ^ hash_ptr((void *)ns, 31)); 343 hash = end_name_hash(hash);
344 hash &= 0x7fffffffU; 344 hash &= 0x7fffffffU;
345 /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */ 345 /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
346 if (hash < 2) 346 if (hash < 2)
diff --git a/fs/namei.c b/fs/namei.c
index 70580ab1445c..7cb9be3e200a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1890,9 +1890,9 @@ static inline unsigned int fold_hash(unsigned long x, unsigned long y)
1890 * payload bytes, to match the way that hash_name() iterates until it 1890 * payload bytes, to match the way that hash_name() iterates until it
1891 * finds the delimiter after the name. 1891 * finds the delimiter after the name.
1892 */ 1892 */
1893unsigned int full_name_hash(const char *name, unsigned int len) 1893unsigned int full_name_hash(const void *salt, const char *name, unsigned int len)
1894{ 1894{
1895 unsigned long a, x = 0, y = 0; 1895 unsigned long a, x = 0, y = (unsigned long)salt;
1896 1896
1897 for (;;) { 1897 for (;;) {
1898 if (!len) 1898 if (!len)
@@ -1911,15 +1911,19 @@ done:
1911EXPORT_SYMBOL(full_name_hash); 1911EXPORT_SYMBOL(full_name_hash);
1912 1912
1913/* Return the "hash_len" (hash and length) of a null-terminated string */ 1913/* Return the "hash_len" (hash and length) of a null-terminated string */
1914u64 hashlen_string(const char *name) 1914u64 hashlen_string(const void *salt, const char *name)
1915{ 1915{
1916 unsigned long a = 0, x = 0, y = 0, adata, mask, len; 1916 unsigned long a = 0, x = 0, y = (unsigned long)salt;
1917 unsigned long adata, mask, len;
1917 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; 1918 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
1918 1919
1919 len = -sizeof(unsigned long); 1920 len = 0;
1921 goto inside;
1922
1920 do { 1923 do {
1921 HASH_MIX(x, y, a); 1924 HASH_MIX(x, y, a);
1922 len += sizeof(unsigned long); 1925 len += sizeof(unsigned long);
1926inside:
1923 a = load_unaligned_zeropad(name+len); 1927 a = load_unaligned_zeropad(name+len);
1924 } while (!has_zero(a, &adata, &constants)); 1928 } while (!has_zero(a, &adata, &constants));
1925 1929
@@ -1935,15 +1939,19 @@ EXPORT_SYMBOL(hashlen_string);
1935 * Calculate the length and hash of the path component, and 1939 * Calculate the length and hash of the path component, and
1936 * return the "hash_len" as the result. 1940 * return the "hash_len" as the result.
1937 */ 1941 */
1938static inline u64 hash_name(const char *name) 1942static inline u64 hash_name(const void *salt, const char *name)
1939{ 1943{
1940 unsigned long a = 0, b, x = 0, y = 0, adata, bdata, mask, len; 1944 unsigned long a = 0, b, x = 0, y = (unsigned long)salt;
1945 unsigned long adata, bdata, mask, len;
1941 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS; 1946 const struct word_at_a_time constants = WORD_AT_A_TIME_CONSTANTS;
1942 1947
1943 len = -sizeof(unsigned long); 1948 len = 0;
1949 goto inside;
1950
1944 do { 1951 do {
1945 HASH_MIX(x, y, a); 1952 HASH_MIX(x, y, a);
1946 len += sizeof(unsigned long); 1953 len += sizeof(unsigned long);
1954inside:
1947 a = load_unaligned_zeropad(name+len); 1955 a = load_unaligned_zeropad(name+len);
1948 b = a ^ REPEAT_BYTE('/'); 1956 b = a ^ REPEAT_BYTE('/');
1949 } while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata, &constants))); 1957 } while (!(has_zero(a, &adata, &constants) | has_zero(b, &bdata, &constants)));
@@ -1959,9 +1967,9 @@ static inline u64 hash_name(const char *name)
1959#else /* !CONFIG_DCACHE_WORD_ACCESS: Slow, byte-at-a-time version */ 1967#else /* !CONFIG_DCACHE_WORD_ACCESS: Slow, byte-at-a-time version */
1960 1968
1961/* Return the hash of a string of known length */ 1969/* Return the hash of a string of known length */
1962unsigned int full_name_hash(const char *name, unsigned int len) 1970unsigned int full_name_hash(const void *salt, const char *name, unsigned int len)
1963{ 1971{
1964 unsigned long hash = init_name_hash(); 1972 unsigned long hash = init_name_hash(salt);
1965 while (len--) 1973 while (len--)
1966 hash = partial_name_hash((unsigned char)*name++, hash); 1974 hash = partial_name_hash((unsigned char)*name++, hash);
1967 return end_name_hash(hash); 1975 return end_name_hash(hash);
@@ -1969,9 +1977,9 @@ unsigned int full_name_hash(const char *name, unsigned int len)
1969EXPORT_SYMBOL(full_name_hash); 1977EXPORT_SYMBOL(full_name_hash);
1970 1978
1971/* Return the "hash_len" (hash and length) of a null-terminated string */ 1979/* Return the "hash_len" (hash and length) of a null-terminated string */
1972u64 hashlen_string(const char *name) 1980u64 hashlen_string(const void *salt, const char *name)
1973{ 1981{
1974 unsigned long hash = init_name_hash(); 1982 unsigned long hash = init_name_hash(salt);
1975 unsigned long len = 0, c; 1983 unsigned long len = 0, c;
1976 1984
1977 c = (unsigned char)*name; 1985 c = (unsigned char)*name;
@@ -1988,9 +1996,9 @@ EXPORT_SYMBOL(hashlen_string);
1988 * We know there's a real path component here of at least 1996 * We know there's a real path component here of at least
1989 * one character. 1997 * one character.
1990 */ 1998 */
1991static inline u64 hash_name(const char *name) 1999static inline u64 hash_name(const void *salt, const char *name)
1992{ 2000{
1993 unsigned long hash = init_name_hash(); 2001 unsigned long hash = init_name_hash(salt);
1994 unsigned long len = 0, c; 2002 unsigned long len = 0, c;
1995 2003
1996 c = (unsigned char)*name; 2004 c = (unsigned char)*name;
@@ -2030,7 +2038,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
2030 if (err) 2038 if (err)
2031 return err; 2039 return err;
2032 2040
2033 hash_len = hash_name(name); 2041 hash_len = hash_name(nd->path.dentry, name);
2034 2042
2035 type = LAST_NORM; 2043 type = LAST_NORM;
2036 if (name[0] == '.') switch (hashlen_len(hash_len)) { 2044 if (name[0] == '.') switch (hashlen_len(hash_len)) {
@@ -2436,7 +2444,7 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
2436 2444
2437 this.name = name; 2445 this.name = name;
2438 this.len = len; 2446 this.len = len;
2439 this.hash = full_name_hash(name, len); 2447 this.hash = full_name_hash(base, name, len);
2440 if (!len) 2448 if (!len)
2441 return ERR_PTR(-EACCES); 2449 return ERR_PTR(-EACCES);
2442 2450
@@ -2489,7 +2497,7 @@ struct dentry *lookup_one_len_unlocked(const char *name,
2489 2497
2490 this.name = name; 2498 this.name = name;
2491 this.len = len; 2499 this.len = len;
2492 this.hash = full_name_hash(name, len); 2500 this.hash = full_name_hash(base, name, len);
2493 if (!len) 2501 if (!len)
2494 return ERR_PTR(-EACCES); 2502 return ERR_PTR(-EACCES);
2495 2503
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index bfdad003ee56..9add7ab747a5 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -139,7 +139,7 @@ ncp_hash_dentry(const struct dentry *dentry, struct qstr *this)
139 int i; 139 int i;
140 140
141 t = NCP_IO_TABLE(sb); 141 t = NCP_IO_TABLE(sb);
142 hash = init_name_hash(); 142 hash = init_name_hash(dentry);
143 for (i=0; i<this->len ; i++) 143 for (i=0; i<this->len ; i++)
144 hash = partial_name_hash(ncp_tolower(t, this->name[i]), 144 hash = partial_name_hash(ncp_tolower(t, this->name[i]),
145 hash); 145 hash);
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index aaf7bd0cbae2..d6935a9e8fdd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -232,7 +232,7 @@ int nfs_readdir_make_qstr(struct qstr *string, const char *name, unsigned int le
232 * in a page cache page which kmemleak does not scan. 232 * in a page cache page which kmemleak does not scan.
233 */ 233 */
234 kmemleak_not_leak(string->name); 234 kmemleak_not_leak(string->name);
235 string->hash = full_name_hash(name, len); 235 string->hash = full_name_hash(NULL, name, len);
236 return 0; 236 return 0;
237} 237}
238 238
@@ -497,7 +497,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
497 if (filename.len == 2 && filename.name[1] == '.') 497 if (filename.len == 2 && filename.name[1] == '.')
498 return; 498 return;
499 } 499 }
500 filename.hash = full_name_hash(filename.name, filename.len); 500 filename.hash = full_name_hash(parent, filename.name, filename.len);
501 501
502 dentry = d_lookup(parent, &filename); 502 dentry = d_lookup(parent, &filename);
503again: 503again:
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 443abecf01b7..358258364616 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -253,7 +253,7 @@ handle_name:
253 err = (signed)nls_name.len; 253 err = (signed)nls_name.len;
254 goto err_out; 254 goto err_out;
255 } 255 }
256 nls_name.hash = full_name_hash(nls_name.name, nls_name.len); 256 nls_name.hash = full_name_hash(dent, nls_name.name, nls_name.len);
257 257
258 dent = d_add_ci(dent, dent_inode, &nls_name); 258 dent = d_add_ci(dent, dent_inode, &nls_name);
259 kfree(nls_name.name); 259 kfree(nls_name.name);
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
index 004f2cbe8f71..8107d0d0c3f6 100644
--- a/fs/ocfs2/dlm/dlmcommon.h
+++ b/fs/ocfs2/dlm/dlmcommon.h
@@ -47,7 +47,7 @@
47#define DLM_HASH_BUCKETS (DLM_HASH_PAGES * DLM_BUCKETS_PER_PAGE) 47#define DLM_HASH_BUCKETS (DLM_HASH_PAGES * DLM_BUCKETS_PER_PAGE)
48 48
49/* Intended to make it easier for us to switch out hash functions */ 49/* Intended to make it easier for us to switch out hash functions */
50#define dlm_lockid_hash(_n, _l) full_name_hash(_n, _l) 50#define dlm_lockid_hash(_n, _l) full_name_hash(NULL, _n, _l)
51 51
52enum dlm_mle_type { 52enum dlm_mle_type {
53 DLM_MLE_BLOCK = 0, 53 DLM_MLE_BLOCK = 0,
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 5e57c3e46e1d..b59db94d2ff4 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -623,7 +623,7 @@ static bool proc_sys_fill_cache(struct file *file,
623 623
624 qname.name = table->procname; 624 qname.name = table->procname;
625 qname.len = strlen(table->procname); 625 qname.len = strlen(table->procname);
626 qname.hash = full_name_hash(qname.name, qname.len); 626 qname.hash = full_name_hash(dir, qname.name, qname.len);
627 627
628 child = d_lookup(dir, &qname); 628 child = d_lookup(dir, &qname);
629 if (!child) { 629 if (!child) {
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c
index 90b60c03b588..a42de45ce40d 100644
--- a/fs/sysv/namei.c
+++ b/fs/sysv/namei.c
@@ -33,7 +33,7 @@ static int sysv_hash(const struct dentry *dentry, struct qstr *qstr)
33 function. */ 33 function. */
34 if (qstr->len > SYSV_NAMELEN) { 34 if (qstr->len > SYSV_NAMELEN) {
35 qstr->len = SYSV_NAMELEN; 35 qstr->len = SYSV_NAMELEN;
36 qstr->hash = full_name_hash(qstr->name, qstr->len); 36 qstr->hash = full_name_hash(dentry, qstr->name, qstr->len);
37 } 37 }
38 return 0; 38 return 0;
39} 39}