From 732dbef606f22a23cb3e1029d613977ec645e8ae Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 7 Jul 2005 17:57:29 -0700 Subject: [PATCH] [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 Acked-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/dcookies.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/dcookies.c b/fs/dcookies.c index 581aac959cd3..02aa0ddc582a 100644 --- a/fs/dcookies.c +++ b/fs/dcookies.c @@ -94,12 +94,10 @@ static struct dcookie_struct * alloc_dcookie(struct dentry * dentry, 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; -- 2.30.2