Skip to contentSkip to conversation

xfs: d_add_ci() and dcache handling

DISCUSSION OGAWA Hirofumi 2 participants 2 messages Aug 17, 2008 – Aug 18, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I'm playing with dcache codes recently. Then, by chance, I found newly added dcache handling looks a bit strange.

xfs_vn_ci_lookup() doesn't create negative dentry (doesn't d_add(dentry, NULL)), it would be no problem.

But creation path also doesn't do d_rehash() for it, even if it's passed the non d_rehash()ed dentry. I.e. it just does d_instantiate().

Although I don't know whether it's a intent or not, maybe CI version wants to do d_add() instead of d_instantiate()?

Thanks.

Signature · 1 line
OGAWA Hirofumi <[email protected]>
#1 lore raw
Quoted 5 lines · OGAWA Hirofumi

Hi,

I'm playing with dcache codes recently. Then, by chance, I found newly added dcache handling looks a bit strange.

Quoted 8 lines

xfs_vn_ci_lookup() doesn't create negative dentry (doesn't d_add(dentry, NULL)), it would be no problem.

But creation path also doesn't do d_rehash() for it, even if it's passed the non d_rehash()ed dentry. I.e. it just does d_instantiate().

Although I don't know whether it's a intent or not, maybe CI version wants to do d_add() instead of d_instantiate()?

Curious, I even posted the following in the patch that added the CI support, but I can't see it in the code:

fs/xfs/linux-2.6/xfs_iops.c +2 -0
Index: kern_ci/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
@@ -345,6 +345,8 @@ xfs_vn_mknod(
 	if (S_ISDIR(mode))
 		xfs_validate_fields(inode);
 	d_instantiate(dentry, inode);
+	if (d_unhashed(dentry))
+		d_rehash(dentry);
 	xfs_validate_fields(dir);
 	return -error;
 

So, I'm not sure what happened to that hunk.

Barry.