linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Sven Eckelmann <sven@narfation.org>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org
Subject: [PATCHv4 07/11] ext4: Use *_dec_not_zero instead of *_add_unless
Date: Wed, 27 Jul 2011 11:47:46 +0200	[thread overview]
Message-ID: <1311760070-21532-7-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1311760070-21532-1-git-send-email-sven@narfation.org>

atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
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,
-- 
1.7.5.4

           reply	other threads:[~2011-07-27  9:47 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1311760070-21532-1-git-send-email-sven@narfation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311760070-21532-7-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).