aboutsummaryrefslogtreecommitdiffstats
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)
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:
124 return acct->active; 124 return acct->active;
125} 125}
126 126
127static void acct_put(struct bsd_acct_struct *p)
128{
129 if (atomic_long_dec_and_test(&p->pin.count))
130 kfree_rcu(p, pin.rcu);
131}
132
127static struct bsd_acct_struct *acct_get(struct pid_namespace *ns) 133static struct bsd_acct_struct *acct_get(struct pid_namespace *ns)
128{ 134{
129 struct bsd_acct_struct *res; 135 struct bsd_acct_struct *res;
@@ -144,7 +150,7 @@ again:
144 mutex_lock(&res->lock); 150 mutex_lock(&res->lock);
145 if (!res->ns) { 151 if (!res->ns) {
146 mutex_unlock(&res->lock); 152 mutex_unlock(&res->lock);
147 pin_put(&res->pin); 153 acct_put(res);
148 goto again; 154 goto again;
149 } 155 }
150 return res; 156 return res;
@@ -175,7 +181,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
175 acct->ns = NULL; 181 acct->ns = NULL;
176 atomic_long_dec(&acct->pin.count); 182 atomic_long_dec(&acct->pin.count);
177 mutex_unlock(&acct->lock); 183 mutex_unlock(&acct->lock);
178 pin_put(&acct->pin); 184 acct_put(acct);
179 } 185 }
180} 186}
181 187
@@ -186,7 +192,7 @@ static void acct_pin_kill(struct fs_pin *pin)
186 mutex_lock(&acct->lock); 192 mutex_lock(&acct->lock);
187 if (!acct->ns) { 193 if (!acct->ns) {
188 mutex_unlock(&acct->lock); 194 mutex_unlock(&acct->lock);
189 pin_put(pin); 195 acct_put(acct);
190 acct = NULL; 196 acct = NULL;
191 } 197 }
192 acct_kill(acct, NULL); 198 acct_kill(acct, NULL);
@@ -576,7 +582,7 @@ static void slow_acct_process(struct pid_namespace *ns)
576 if (acct) { 582 if (acct) {
577 do_acct_process(acct); 583 do_acct_process(acct);
578 mutex_unlock(&acct->lock); 584 mutex_unlock(&acct->lock);
579 pin_put(&acct->pin); 585 acct_put(acct);
580 } 586 }
581 } 587 }
582} 588}