From patchwork Wed Jul 27 09:47:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCHv4,07/11] ext4: Use *_dec_not_zero instead of *_add_unless Date: Tue, 26 Jul 2011 23:47:46 -0000 From: Sven Eckelmann X-Patchwork-Id: 107016 Message-Id: <1311760070-21532-7-git-send-email-sven@narfation.org> To: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Sven Eckelmann , "Theodore Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org atomic_dec_not_zero is defined for each architecture through to provide the functionality of atomic_add_unless(x, -1, 0). Signed-off-by: Sven Eckelmann Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: linux-ext4@vger.kernel.org --- fs/ext4/ext4.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index fa44df8..29996e8 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -2098,7 +2098,7 @@ static inline void ext4_lock_group(struct super_block *sb, ext4_group_t group) * We're able to grab the lock right away, so drop the * lock contention counter. */ - atomic_add_unless(&EXT4_SB(sb)->s_lock_busy, -1, 0); + atomic_dec_not_zero(&EXT4_SB(sb)->s_lock_busy); else { /* * The lock is busy, so bump the contention counter,