Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280201
b: refs/heads/master
c: 863d684
h: refs/heads/master
i:
  280199: cad324c
v: v3
  • Loading branch information
Al Viro committed Jan 4, 2012
1 parent c08aa6e commit fce2274
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 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: 15169fe784a9846b24cdb0840329d41aebc23249
refs/heads/master: 863d684f946eb240c7dd57d265d88315950ca5cc
3 changes: 3 additions & 0 deletions trunk/fs/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ struct mount {
struct mnt_namespace *mnt_ns; /* containing namespace */
int mnt_id; /* mount identifier */
int mnt_group_id; /* peer group identifier */
int mnt_expiry_mark; /* true if marked for expiry */
int mnt_pinned;
int mnt_ghosts;
};

static inline struct mount *real_mount(struct vfsmount *mnt)
Expand Down
32 changes: 17 additions & 15 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,9 @@ static void mntput_no_expire(struct mount *mnt)
return;
br_write_lock(vfsmount_lock);
#endif
if (unlikely(mnt->mnt.mnt_pinned)) {
mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1);
mnt->mnt.mnt_pinned = 0;
if (unlikely(mnt->mnt_pinned)) {
mnt_add_count(mnt, mnt->mnt_pinned + 1);
mnt->mnt_pinned = 0;
br_write_unlock(vfsmount_lock);
acct_auto_close_mnt(&mnt->mnt);
goto put_again;
Expand All @@ -801,10 +801,11 @@ static void mntput_no_expire(struct mount *mnt)
void mntput(struct vfsmount *mnt)
{
if (mnt) {
struct mount *m = real_mount(mnt);
/* avoid cacheline pingpong, hope gcc doesn't get "smart" */
if (unlikely(mnt->mnt_expiry_mark))
mnt->mnt_expiry_mark = 0;
mntput_no_expire(real_mount(mnt));
if (unlikely(m->mnt_expiry_mark))
m->mnt_expiry_mark = 0;
mntput_no_expire(m);
}
}
EXPORT_SYMBOL(mntput);
Expand All @@ -820,16 +821,17 @@ EXPORT_SYMBOL(mntget);
void mnt_pin(struct vfsmount *mnt)
{
br_write_lock(vfsmount_lock);
mnt->mnt_pinned++;
real_mount(mnt)->mnt_pinned++;
br_write_unlock(vfsmount_lock);
}
EXPORT_SYMBOL(mnt_pin);

void mnt_unpin(struct vfsmount *mnt)
void mnt_unpin(struct vfsmount *m)
{
struct mount *mnt = real_mount(m);
br_write_lock(vfsmount_lock);
if (mnt->mnt_pinned) {
mnt_add_count(real_mount(mnt), 1);
mnt_add_count(mnt, 1);
mnt->mnt_pinned--;
}
br_write_unlock(vfsmount_lock);
Expand Down Expand Up @@ -1200,17 +1202,17 @@ void release_mounts(struct list_head *head)
list_del_init(&mnt->mnt_hash);
if (mnt_has_parent(mnt)) {
struct dentry *dentry;
struct vfsmount *m;
struct mount *m;

br_write_lock(vfsmount_lock);
dentry = mnt->mnt_mountpoint;
m = &mnt->mnt_parent->mnt;
m = mnt->mnt_parent;
mnt->mnt_mountpoint = mnt->mnt.mnt_root;
mnt->mnt_parent = mnt;
m->mnt_ghosts--;
br_write_unlock(vfsmount_lock);
dput(dentry);
mntput(m);
mntput(&m->mnt);
}
mntput(&mnt->mnt);
}
Expand Down Expand Up @@ -1239,7 +1241,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
__mnt_make_shortterm(p);
list_del_init(&p->mnt_child);
if (mnt_has_parent(p)) {
p->mnt_parent->mnt.mnt_ghosts++;
p->mnt_parent->mnt_ghosts++;
dentry_reset_mounted(p->mnt_mountpoint);
}
change_mnt_propagation(p, MS_PRIVATE);
Expand Down Expand Up @@ -1281,7 +1283,7 @@ static int do_umount(struct mount *mnt, int flags)
}
br_write_unlock(vfsmount_lock);

if (!xchg(&mnt->mnt.mnt_expiry_mark, 1))
if (!xchg(&mnt->mnt_expiry_mark, 1))
return -EAGAIN;
}

Expand Down Expand Up @@ -2106,7 +2108,7 @@ void mark_mounts_for_expiry(struct list_head *mounts)
* cleared by mntput())
*/
list_for_each_entry_safe(mnt, next, mounts, mnt_expire) {
if (!xchg(&mnt->mnt.mnt_expiry_mark, 1) ||
if (!xchg(&mnt->mnt_expiry_mark, 1) ||
propagate_mount_busy(mnt, 1))
continue;
list_move(&mnt->mnt_expire, &graveyard);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/pnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry,
*/
static inline int do_refcount_check(struct mount *mnt, int count)
{
int mycount = mnt_get_count(mnt) - mnt->mnt.mnt_ghosts;
int mycount = mnt_get_count(mnt) - mnt->mnt_ghosts;
return (mycount > count);
}

Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ struct vfsmount {
#endif
const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
struct list_head mnt_list;
int mnt_expiry_mark; /* true if marked for expiry */
int mnt_pinned;
int mnt_ghosts;
};

struct file; /* forward dec */
Expand Down

0 comments on commit fce2274

Please sign in to comment.