aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dcache.c')
-rw-r--r--fs/ocfs2/dcache.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
index e5ba34818332..8db4b58b2e4b 100644
--- a/fs/ocfs2/dcache.c
+++ b/fs/ocfs2/dcache.c
@@ -49,14 +49,13 @@ void ocfs2_dentry_attach_gen(struct dentry *dentry)
49} 49}
50 50
51 51
52static int ocfs2_dentry_revalidate(struct dentry *dentry, 52static int ocfs2_dentry_revalidate(struct dentry *dentry, unsigned int flags)
53 struct nameidata *nd)
54{ 53{
55 struct inode *inode; 54 struct inode *inode;
56 int ret = 0; /* if all else fails, just return false */ 55 int ret = 0; /* if all else fails, just return false */
57 struct ocfs2_super *osb; 56 struct ocfs2_super *osb;
58 57
59 if (nd && nd->flags & LOOKUP_RCU) 58 if (flags & LOOKUP_RCU)
60 return -ECHILD; 59 return -ECHILD;
61 60
62 inode = dentry->d_inode; 61 inode = dentry->d_inode;
@@ -170,13 +169,11 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
170 u64 parent_blkno, 169 u64 parent_blkno,
171 int skip_unhashed) 170 int skip_unhashed)
172{ 171{
173 struct list_head *p; 172 struct hlist_node *p;
174 struct dentry *dentry = NULL; 173 struct dentry *dentry;
175 174
176 spin_lock(&inode->i_lock); 175 spin_lock(&inode->i_lock);
177 list_for_each(p, &inode->i_dentry) { 176 hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) {
178 dentry = list_entry(p, struct dentry, d_alias);
179
180 spin_lock(&dentry->d_lock); 177 spin_lock(&dentry->d_lock);
181 if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { 178 if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
182 trace_ocfs2_find_local_alias(dentry->d_name.len, 179 trace_ocfs2_find_local_alias(dentry->d_name.len,
@@ -184,16 +181,13 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
184 181
185 dget_dlock(dentry); 182 dget_dlock(dentry);
186 spin_unlock(&dentry->d_lock); 183 spin_unlock(&dentry->d_lock);
187 break; 184 spin_unlock(&inode->i_lock);
185 return dentry;
188 } 186 }
189 spin_unlock(&dentry->d_lock); 187 spin_unlock(&dentry->d_lock);
190
191 dentry = NULL;
192 } 188 }
193
194 spin_unlock(&inode->i_lock); 189 spin_unlock(&inode->i_lock);
195 190 return NULL;
196 return dentry;
197} 191}
198 192
199DEFINE_SPINLOCK(dentry_attach_lock); 193DEFINE_SPINLOCK(dentry_attach_lock);