aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-21 18:22:44 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:36 -0400
commitda53be12bbb4fabbe2e9f6f908de0cf478b5161d (patch)
treea0436fb462a7b16c82e58336e17c55b814f7be6b /fs/affs
parent642b704cd7a29be0b8900971eb525086c1c995b7 (diff)
Don't pass inode to ->d_hash() and ->d_compare()
Instances either don't look at it at all (the majority of cases) or only want it to find the superblock (which can be had as dentry->d_sb). A few cases that want more are actually safe with dentry->d_inode - the only precaution needed is the check that it hadn't been replaced with NULL by rmdir() or by overwriting rename(), which case should be simply treated as cache miss. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/namei.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index ff65884a7839..c36cbb4537a2 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -13,18 +13,12 @@
13typedef int (*toupper_t)(int); 13typedef int (*toupper_t)(int);
14 14
15static int affs_toupper(int ch); 15static int affs_toupper(int ch);
16static int affs_hash_dentry(const struct dentry *, 16static int affs_hash_dentry(const struct dentry *, struct qstr *);
17 const struct inode *, struct qstr *); 17static int affs_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
18static int affs_compare_dentry(const struct dentry *parent,
19 const struct inode *pinode,
20 const struct dentry *dentry, const struct inode *inode,
21 unsigned int len, const char *str, const struct qstr *name); 18 unsigned int len, const char *str, const struct qstr *name);
22static int affs_intl_toupper(int ch); 19static int affs_intl_toupper(int ch);
23static int affs_intl_hash_dentry(const struct dentry *, 20static int affs_intl_hash_dentry(const struct dentry *, struct qstr *);
24 const struct inode *, struct qstr *); 21static int affs_intl_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
25static int affs_intl_compare_dentry(const struct dentry *parent,
26 const struct inode *pinode,
27 const struct dentry *dentry, const struct inode *inode,
28 unsigned int len, const char *str, const struct qstr *name); 22 unsigned int len, const char *str, const struct qstr *name);
29 23
30const struct dentry_operations affs_dentry_operations = { 24const struct dentry_operations affs_dentry_operations = {
@@ -86,14 +80,12 @@ __affs_hash_dentry(struct qstr *qstr, toupper_t toupper)
86} 80}
87 81
88static int 82static int
89affs_hash_dentry(const struct dentry *dentry, const struct inode *inode, 83affs_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
90 struct qstr *qstr)
91{ 84{
92 return __affs_hash_dentry(qstr, affs_toupper); 85 return __affs_hash_dentry(qstr, affs_toupper);
93} 86}
94static int 87static int
95affs_intl_hash_dentry(const struct dentry *dentry, const struct inode *inode, 88affs_intl_hash_dentry(const struct dentry *dentry, struct qstr *qstr)
96 struct qstr *qstr)
97{ 89{
98 return __affs_hash_dentry(qstr, affs_intl_toupper); 90 return __affs_hash_dentry(qstr, affs_intl_toupper);
99} 91}
@@ -131,15 +123,13 @@ static inline int __affs_compare_dentry(unsigned int len,
131} 123}
132 124
133static int 125static int
134affs_compare_dentry(const struct dentry *parent, const struct inode *pinode, 126affs_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
135 const struct dentry *dentry, const struct inode *inode,
136 unsigned int len, const char *str, const struct qstr *name) 127 unsigned int len, const char *str, const struct qstr *name)
137{ 128{
138 return __affs_compare_dentry(len, str, name, affs_toupper); 129 return __affs_compare_dentry(len, str, name, affs_toupper);
139} 130}
140static int 131static int
141affs_intl_compare_dentry(const struct dentry *parent,const struct inode *pinode, 132affs_intl_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
142 const struct dentry *dentry, const struct inode *inode,
143 unsigned int len, const char *str, const struct qstr *name) 133 unsigned int len, const char *str, const struct qstr *name)
144{ 134{
145 return __affs_compare_dentry(len, str, name, affs_intl_toupper); 135 return __affs_compare_dentry(len, str, name, affs_intl_toupper);