xfs: d_add_ci() and dcache handling
Subsystems (2)
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]>
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'td_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 doesd_instantiate().Although I don't know whether it's a intent or not, maybe CI version wants to do
d_add()instead ofd_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
@@ -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.