On Sun, 17 Aug 2008 12:52:52 +1000, OGAWA Hirofumi
<hirofumi@xxxxxxxxxxxxxxxxxx> wrote:
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()?
Curious, I even posted the following in the patch that added the CI
support,
but I can't see it in the code:
Index: kern_ci/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
--- kern_ci.orig/fs/xfs/linux-2.6/xfs_iops.c
+++ 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html