]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pull bumping refcount into ->kill()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 10 Jan 2015 05:07:35 +0000 (00:07 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 26 Jan 2015 04:16:29 +0000 (23:16 -0500)
there will be one more change of ->kill() calling conventions; this
isn't final.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fs_pin.c
kernel/acct.c

index f173313760b8e61e06fb3466cb48d1f436f20371..5eb39a93a560a6f7e8e61bf7a8221ac25424d8ff 100644 (file)
@@ -34,12 +34,6 @@ void mnt_pin_kill(struct mount *m)
                        break;
                }
                pin = hlist_entry(p, struct fs_pin, m_list);
-               if (!atomic_long_inc_not_zero(&pin->count)) {
-                       rcu_read_unlock();
-                       cpu_relax();
-                       continue;
-               }
-               rcu_read_unlock();
                pin->kill(pin);
        }
 }
@@ -56,12 +50,6 @@ void sb_pin_kill(struct super_block *sb)
                        break;
                }
                pin = hlist_entry(p, struct fs_pin, s_list);
-               if (!atomic_long_inc_not_zero(&pin->count)) {
-                       rcu_read_unlock();
-                       cpu_relax();
-                       continue;
-               }
-               rcu_read_unlock();
                pin->kill(pin);
        }
 }
index 7bb9e659a7da7f2530830df0dca01fa02a5e0fef..a74f3d1a0c2689152ac1c438c0babd7508614d9b 100644 (file)
@@ -189,6 +189,12 @@ static void acct_pin_kill(struct fs_pin *pin)
 {
        struct bsd_acct_struct *acct;
        acct = container_of(pin, struct bsd_acct_struct, pin);
+       if (!atomic_long_inc_not_zero(&pin->count)) {
+               rcu_read_unlock();
+               cpu_relax();
+               return;
+       }
+       rcu_read_unlock();
        mutex_lock(&acct->lock);
        if (!acct->ns) {
                mutex_unlock(&acct->lock);