aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-01-10 00:07:35 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-01-25 23:16:29 -0500
commit32426f6653cbfde1ca16aff27a530ee36332f796 (patch)
tree87c9d86a5c164745acaf0a20a0ff92485c070bd2
parent9e251d02041432487d89cb340e72490c4bbc198a (diff)
pull bumping refcount into ->kill()
there will be one more change of ->kill() calling conventions; this isn't final. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/fs_pin.c12
-rw-r--r--kernel/acct.c6
2 files changed, 6 insertions, 12 deletions
diff --git a/fs/fs_pin.c b/fs/fs_pin.c
index f173313760b8..5eb39a93a560 100644
--- a/fs/fs_pin.c
+++ b/fs/fs_pin.c
@@ -34,12 +34,6 @@ void mnt_pin_kill(struct mount *m)
34 break; 34 break;
35 } 35 }
36 pin = hlist_entry(p, struct fs_pin, m_list); 36 pin = hlist_entry(p, struct fs_pin, m_list);
37 if (!atomic_long_inc_not_zero(&pin->count)) {
38 rcu_read_unlock();
39 cpu_relax();
40 continue;
41 }
42 rcu_read_unlock();
43 pin->kill(pin); 37 pin->kill(pin);
44 } 38 }
45} 39}
@@ -56,12 +50,6 @@ void sb_pin_kill(struct super_block *sb)
56 break; 50 break;
57 } 51 }
58 pin = hlist_entry(p, struct fs_pin, s_list); 52 pin = hlist_entry(p, struct fs_pin, s_list);
59 if (!atomic_long_inc_not_zero(&pin->count)) {
60 rcu_read_unlock();
61 cpu_relax();
62 continue;
63 }
64 rcu_read_unlock();
65 pin->kill(pin); 53 pin->kill(pin);
66 } 54 }
67} 55}
diff --git a/kernel/acct.c b/kernel/acct.c
index 7bb9e659a7da..a74f3d1a0c26 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -189,6 +189,12 @@ static void acct_pin_kill(struct fs_pin *pin)
189{ 189{
190 struct bsd_acct_struct *acct; 190 struct bsd_acct_struct *acct;
191 acct = container_of(pin, struct bsd_acct_struct, pin); 191 acct = container_of(pin, struct bsd_acct_struct, pin);
192 if (!atomic_long_inc_not_zero(&pin->count)) {
193 rcu_read_unlock();
194 cpu_relax();
195 return;
196 }
197 rcu_read_unlock();
192 mutex_lock(&acct->lock); 198 mutex_lock(&acct->lock);
193 if (!acct->ns) { 199 if (!acct->ns) {
194 mutex_unlock(&acct->lock); 200 mutex_unlock(&acct->lock);