Lines Matching refs:dentry
26 void ocfs2_dentry_attach_gen(struct dentry *dentry) in ocfs2_dentry_attach_gen() argument
29 OCFS2_I(d_inode(dentry->d_parent))->ip_dir_lock_gen; in ocfs2_dentry_attach_gen()
30 BUG_ON(d_inode(dentry)); in ocfs2_dentry_attach_gen()
31 dentry->d_fsdata = (void *)gen; in ocfs2_dentry_attach_gen()
35 static int ocfs2_dentry_revalidate(struct dentry *dentry, unsigned int flags) in ocfs2_dentry_revalidate() argument
44 inode = d_inode(dentry); in ocfs2_dentry_revalidate()
45 osb = OCFS2_SB(dentry->d_sb); in ocfs2_dentry_revalidate()
47 trace_ocfs2_dentry_revalidate(dentry, dentry->d_name.len, in ocfs2_dentry_revalidate()
48 dentry->d_name.name); in ocfs2_dentry_revalidate()
55 unsigned long gen = (unsigned long) dentry->d_fsdata; in ocfs2_dentry_revalidate()
57 spin_lock(&dentry->d_lock); in ocfs2_dentry_revalidate()
58 pgen = OCFS2_I(d_inode(dentry->d_parent))->ip_dir_lock_gen; in ocfs2_dentry_revalidate()
59 spin_unlock(&dentry->d_lock); in ocfs2_dentry_revalidate()
60 trace_ocfs2_dentry_revalidate_negative(dentry->d_name.len, in ocfs2_dentry_revalidate()
61 dentry->d_name.name, in ocfs2_dentry_revalidate()
98 if (!dentry->d_fsdata) { in ocfs2_dentry_revalidate()
112 static int ocfs2_match_dentry(struct dentry *dentry, in ocfs2_match_dentry() argument
124 if (!dentry->d_fsdata) in ocfs2_match_dentry()
127 if (!dentry->d_parent) in ocfs2_match_dentry()
130 if (skip_unhashed && d_unhashed(dentry)) in ocfs2_match_dentry()
133 parent = d_inode(dentry->d_parent); in ocfs2_match_dentry()
152 struct dentry *ocfs2_find_local_alias(struct inode *inode, in ocfs2_find_local_alias()
156 struct dentry *dentry; in ocfs2_find_local_alias() local
159 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { in ocfs2_find_local_alias()
160 spin_lock(&dentry->d_lock); in ocfs2_find_local_alias()
161 if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { in ocfs2_find_local_alias()
162 trace_ocfs2_find_local_alias(dentry->d_name.len, in ocfs2_find_local_alias()
163 dentry->d_name.name); in ocfs2_find_local_alias()
165 dget_dlock(dentry); in ocfs2_find_local_alias()
166 spin_unlock(&dentry->d_lock); in ocfs2_find_local_alias()
168 return dentry; in ocfs2_find_local_alias()
170 spin_unlock(&dentry->d_lock); in ocfs2_find_local_alias()
210 int ocfs2_dentry_attach_lock(struct dentry *dentry, in ocfs2_dentry_attach_lock() argument
215 struct dentry *alias; in ocfs2_dentry_attach_lock()
216 struct ocfs2_dentry_lock *dl = dentry->d_fsdata; in ocfs2_dentry_attach_lock()
218 trace_ocfs2_dentry_attach_lock(dentry->d_name.len, dentry->d_name.name, in ocfs2_dentry_attach_lock()
230 if (d_really_is_negative(dentry) && dentry->d_fsdata) { in ocfs2_dentry_attach_lock()
233 dentry->d_fsdata = dl = NULL; in ocfs2_dentry_attach_lock()
239 dentry, in ocfs2_dentry_attach_lock()
265 dentry, in ocfs2_dentry_attach_lock()
297 if (unlikely(dentry->d_fsdata && !alias)) { in ocfs2_dentry_attach_lock()
309 dentry->d_fsdata = dl; in ocfs2_dentry_attach_lock()
318 ret = ocfs2_dentry_lock(dentry, 0); in ocfs2_dentry_attach_lock()
320 ocfs2_dentry_unlock(dentry, 0); in ocfs2_dentry_attach_lock()
333 dentry->d_fsdata = NULL; in ocfs2_dentry_attach_lock()
390 static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode) in ocfs2_dentry_iput() argument
392 struct ocfs2_dentry_lock *dl = dentry->d_fsdata; in ocfs2_dentry_iput()
399 if (!(dentry->d_flags & DCACHE_DISCONNECTED) && in ocfs2_dentry_iput()
400 !d_unhashed(dentry)) { in ocfs2_dentry_iput()
406 ino, dentry->d_flags, dentry); in ocfs2_dentry_iput()
413 dentry, dl->dl_count); in ocfs2_dentry_iput()
415 ocfs2_dentry_lock_put(OCFS2_SB(dentry->d_sb), dl); in ocfs2_dentry_iput()
440 void ocfs2_dentry_move(struct dentry *dentry, struct dentry *target, in ocfs2_dentry_move() argument
445 struct inode *inode = d_inode(dentry); in ocfs2_dentry_move()
456 ocfs2_dentry_lock_put(osb, dentry->d_fsdata); in ocfs2_dentry_move()
458 dentry->d_fsdata = NULL; in ocfs2_dentry_move()
459 ret = ocfs2_dentry_attach_lock(dentry, inode, OCFS2_I(new_dir)->ip_blkno); in ocfs2_dentry_move()
464 d_move(dentry, target); in ocfs2_dentry_move()