summaryrefslogtreecommitdiffstats
path: root/kernel/acct.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-01-09 20:40:02 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-01-25 23:16:28 -0500
commit9e251d02041432487d89cb340e72490c4bbc198a (patch)
tree2b8381a585758a1281f8121cc96aebfbb7d23e02 /kernel/acct.c
parent92fc41c3a612d27521241e2a550d938520fce0d6 (diff)
downloadlinux-9e251d02041432487d89cb340e72490c4bbc198a.tar.gz
linux-9e251d02041432487d89cb340e72490c4bbc198a.tar.bz2
linux-9e251d02041432487d89cb340e72490c4bbc198a.zip
kill pin_put()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/acct.c')
-rw-r--r--kernel/acct.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index 33738ef972f3..7bb9e659a7da 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -124,6 +124,12 @@ out:
return acct->active;
}
+static void acct_put(struct bsd_acct_struct *p)
+{
+ if (atomic_long_dec_and_test(&p->pin.count))
+ kfree_rcu(p, pin.rcu);
+}
+
static struct bsd_acct_struct *acct_get(struct pid_namespace *ns)
{
struct bsd_acct_struct *res;
@@ -144,7 +150,7 @@ again:
mutex_lock(&res->lock);
if (!res->ns) {
mutex_unlock(&res->lock);
- pin_put(&res->pin);
+ acct_put(res);
goto again;
}
return res;
@@ -175,7 +181,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
acct->ns = NULL;
atomic_long_dec(&acct->pin.count);
mutex_unlock(&acct->lock);
- pin_put(&acct->pin);
+ acct_put(acct);
}
}
@@ -186,7 +192,7 @@ static void acct_pin_kill(struct fs_pin *pin)
mutex_lock(&acct->lock);
if (!acct->ns) {
mutex_unlock(&acct->lock);
- pin_put(pin);
+ acct_put(acct);
acct = NULL;
}
acct_kill(acct, NULL);
@@ -576,7 +582,7 @@ static void slow_acct_process(struct pid_namespace *ns)
if (acct) {
do_acct_process(acct);
mutex_unlock(&acct->lock);
- pin_put(&acct->pin);
+ acct_put(acct);
}
}
}