Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280142
b: refs/heads/master
c: aa9c0e0
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jan 4, 2012
1 parent a99062f commit 691bd48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bad0dcffc21d17a07dbb83a2bf764f35a57feba5
refs/heads/master: aa9c0e07bb90589186f3b5a0ca97660c2cb50806
35 changes: 5 additions & 30 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,31 +152,6 @@ static inline void mnt_add_count(struct vfsmount *mnt, int n)
#endif
}

static inline void mnt_set_count(struct vfsmount *mnt, int n)
{
#ifdef CONFIG_SMP
this_cpu_write(mnt->mnt_pcp->mnt_count, n);
#else
mnt->mnt_count = n;
#endif
}

/*
* vfsmount lock must be held for read
*/
static inline void mnt_inc_count(struct vfsmount *mnt)
{
mnt_add_count(mnt, 1);
}

/*
* vfsmount lock must be held for read
*/
static inline void mnt_dec_count(struct vfsmount *mnt)
{
mnt_add_count(mnt, -1);
}

/*
* vfsmount lock must be held for write
*/
Expand Down Expand Up @@ -780,20 +755,20 @@ static void mntput_no_expire(struct vfsmount *mnt)
#ifdef CONFIG_SMP
br_read_lock(vfsmount_lock);
if (likely(atomic_read(&mnt->mnt_longterm))) {
mnt_dec_count(mnt);
mnt_add_count(mnt, -1);
br_read_unlock(vfsmount_lock);
return;
}
br_read_unlock(vfsmount_lock);

br_write_lock(vfsmount_lock);
mnt_dec_count(mnt);
mnt_add_count(mnt, -1);
if (mnt_get_count(mnt)) {
br_write_unlock(vfsmount_lock);
return;
}
#else
mnt_dec_count(mnt);
mnt_add_count(mnt, -1);
if (likely(mnt_get_count(mnt)))
return;
br_write_lock(vfsmount_lock);
Expand Down Expand Up @@ -823,7 +798,7 @@ EXPORT_SYMBOL(mntput);
struct vfsmount *mntget(struct vfsmount *mnt)
{
if (mnt)
mnt_inc_count(mnt);
mnt_add_count(mnt, 1);
return mnt;
}
EXPORT_SYMBOL(mntget);
Expand All @@ -840,7 +815,7 @@ void mnt_unpin(struct vfsmount *mnt)
{
br_write_lock(vfsmount_lock);
if (mnt->mnt_pinned) {
mnt_inc_count(mnt);
mnt_add_count(mnt, 1);
mnt->mnt_pinned--;
}
br_write_unlock(vfsmount_lock);
Expand Down

0 comments on commit 691bd48

Please sign in to comment.