27 #include <linux/types.h>
28 #include <linux/slab.h>
46 OCFS2_I(dentry->
d_parent->d_inode)->ip_dir_lock_gen;
64 trace_ocfs2_dentry_revalidate(dentry, dentry->
d_name.len,
74 OCFS2_I(dentry->
d_parent->d_inode)->ip_dir_lock_gen;
76 trace_ocfs2_dentry_revalidate_negative(dentry->
d_name.len,
89 spin_lock(&OCFS2_I(inode)->ip_lock);
92 spin_unlock(&OCFS2_I(inode)->ip_lock);
93 trace_ocfs2_dentry_revalidate_delete(
94 (
unsigned long long)OCFS2_I(inode)->ip_blkno);
97 spin_unlock(&OCFS2_I(inode)->ip_lock);
104 trace_ocfs2_dentry_revalidate_orphaned(
105 (
unsigned long long)OCFS2_I(inode)->ip_blkno,
115 trace_ocfs2_dentry_revalidate_nofsdata(
116 (
unsigned long long)OCFS2_I(inode)->ip_blkno);
124 trace_ocfs2_dentry_revalidate_ret(ret);
128 static int ocfs2_match_dentry(
struct dentry *dentry,
146 if (skip_unhashed && d_unhashed(dentry))
155 if (OCFS2_I(parent)->ip_blkno != parent_blkno)
173 struct dentry *dentry;
175 spin_lock(&inode->
i_lock);
177 spin_lock(&dentry->
d_lock);
178 if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
179 trace_ocfs2_find_local_alias(dentry->
d_name.len,
183 spin_unlock(&dentry->
d_lock);
184 spin_unlock(&inode->
i_lock);
187 spin_unlock(&dentry->
d_lock);
189 spin_unlock(&inode->
i_lock);
232 struct dentry *
alias;
235 trace_ocfs2_dentry_attach_lock(dentry->
d_name.len, dentry->
d_name.name,
236 (
unsigned long long)parent_blkno, dl);
255 " \"%.*s\": old parent: %llu, new: %llu\n",
257 (
unsigned long long)parent_blkno,
277 (
unsigned long long)parent_blkno,
278 (
unsigned long long)OCFS2_I(inode)->ip_blkno);
281 " \"%.*s\": old parent: %llu, new: %llu\n",
283 (
unsigned long long)parent_blkno,
286 trace_ocfs2_dentry_attach_lock_found(dl->
dl_lockres.l_name,
287 (
unsigned long long)parent_blkno,
288 (
unsigned long long)OCFS2_I(inode)->ip_blkno);
334 if (ret < 0 && !alias) {
353 #define DL_INODE_DROP_COUNT 64
356 static void __ocfs2_drop_dl_inodes(
struct ocfs2_super *osb,
int drop_count)
392 __ocfs2_drop_dl_inodes(osb, -1);
416 static void ocfs2_drop_dentry_lock(
struct ocfs2_super *osb,
424 spin_lock(&dentry_list_lock);
430 spin_unlock(&dentry_list_lock);
446 ocfs2_drop_dentry_lock(osb, dl);
449 static void ocfs2_dentry_iput(
struct dentry *dentry,
struct inode *inode)
459 !d_unhashed(dentry)) {
460 unsigned long long ino = 0ULL;
462 ino = (
unsigned long long)OCFS2_I(inode)->ip_blkno;
464 "inode: %llu, d_flags: 0x%x, d_name: %.*s\n",
502 struct inode *old_dir,
struct inode *new_dir)
506 struct inode *inode = dentry->
d_inode;
514 if (old_dir == new_dir)
529 .d_revalidate = ocfs2_dentry_revalidate,
530 .d_iput = ocfs2_dentry_iput,