Commit 732dbef6 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds
Browse files

[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: default avatarMiklos Szeredi <>
Acked-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 484e389c
...@@ -94,12 +94,10 @@ static struct dcookie_struct * alloc_dcookie(struct dentry * dentry, ...@@ -94,12 +94,10 @@ static struct dcookie_struct * alloc_dcookie(struct dentry * dentry,
if (!dcs) if (!dcs)
return NULL; return NULL;
dentry->d_cookie = dcs; dentry->d_cookie = dcs;
dcs->dentry = dentry; dcs->dentry = dget(dentry);
dcs->vfsmnt = vfsmnt; dcs->vfsmnt = mntget(vfsmnt);
hash_dcookie(dcs); hash_dcookie(dcs);
return dcs; return dcs;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment