From: Al Viro Date: Sat, 10 Jan 2015 05:07:35 +0000 (-0500) Subject: pull bumping refcount into ->kill() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=32426f6653cbfde1ca16aff27a530ee36332f796;p=openwrt%2Fstaging%2Fblogic.git pull bumping refcount into ->kill() there will be one more change of ->kill() calling conventions; this isn't final. Signed-off-by: Al Viro --- 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) 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); } } 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) { 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);