tree 513e7230a59a526a09b387b5a2628a2eed3a80bb
parent 484e389c63472a7f8cfb491cf11b047364e59365
author Miklos Szeredi <[EMAIL PROTECTED]> Fri, 08 Jul 2005 07:57:29 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Fri, 08 Jul 2005 08:23:52 -0700
[PATCH] dcookies.c: use proper refcounting functions
Dcookies shouldn't play with the internals of dentry and vfsmnt
refcounting. It defeats grepping, and is prone to break if implementation
details change.
In addition the function doesn't even seem to be performance critical: it
calls kmem_cache_alloc().
Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]>
Acked-by: Christoph Hellwig <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
fs/dcookies.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/dcookies.c b/fs/dcookies.c
--- a/fs/dcookies.c
+++ b/fs/dcookies.c
@@ -94,12 +94,10 @@ static struct dcookie_struct * alloc_dco
if (!dcs)
return NULL;
- atomic_inc(&dentry->d_count);
- atomic_inc(&vfsmnt->mnt_count);
dentry->d_cookie = dcs;
- dcs->dentry = dentry;
- dcs->vfsmnt = vfsmnt;
+ dcs->dentry = dget(dentry);
+ dcs->vfsmnt = mntget(vfsmnt);
hash_dcookie(dcs);
return dcs;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html