提交 732dbef6 编写于 作者: M Miklos Szeredi 提交者: Linus Torvalds

[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: NMiklos Szeredi <miklos@szeredi.hu>
Acked-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 484e389c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册