Skip to content

Commit

Permalink
[PATCH] dcookies.c: use proper refcounting functions
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
szmi authored and Linus Torvalds committed Jul 8, 2005
1 parent 484e389 commit 732dbef
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/dcookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 732dbef

Please sign in to comment.