Skip to content

Commit

Permalink
acct: move mnt_pin() upwards.
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 7, 2014
1 parent 17c0a5a commit 215748e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/acct.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ static void acct_kill(struct bsd_acct_struct *acct,
ns->bacct = new;
if (new) {
struct vfsmount *m = new->file->f_path.mnt;
mnt_pin(m);
spin_lock(&acct_lock);
hlist_add_head(&new->s_list, &m->mnt_sb->s_pins);
hlist_add_head(&new->m_list, &real_mount(m)->mnt_pins);
Expand Down Expand Up @@ -256,6 +255,7 @@ static int acct_on(struct filename *pathname)
acct->ns = ns;
mutex_init(&acct->lock);
mnt = file->f_path.mnt;
mnt_pin(mnt);

old = acct_get(ns);
mutex_lock_nested(&acct->lock, 1); /* nobody has seen it yet */
Expand All @@ -264,7 +264,6 @@ static int acct_on(struct filename *pathname)
} else {
ns->bacct = acct;
spin_lock(&acct_lock);
mnt_pin(mnt);
hlist_add_head(&acct->s_list, &mnt->mnt_sb->s_pins);
hlist_add_head(&acct->m_list, &real_mount(mnt)->mnt_pins);
spin_unlock(&acct_lock);
Expand Down

0 comments on commit 215748e

Please sign in to comment.