From: Miklos Szeredi <miklos@szeredi.hu>

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 <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/dcookies.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -puN fs/dcookies.c~dcookiesc-use-proper-refcounting-functions fs/dcookies.c
--- 25/fs/dcookies.c~dcookiesc-use-proper-refcounting-functions	Wed May 25 14:58:29 2005
+++ 25-akpm/fs/dcookies.c	Wed May 25 14:58:29 2005
@@ -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;
_