xfs
[Top] [All Lists]

[PATCHv4 08/11] xfs: Use *_dec_not_zero instead of *_add_unless

To: linux-arch@xxxxxxxxxxxxxxx
Subject: [PATCHv4 08/11] xfs: Use *_dec_not_zero instead of *_add_unless
From: Sven Eckelmann <sven@xxxxxxxxxxxxx>
Date: Wed, 27 Jul 2011 11:47:47 +0200
Cc: linux-kernel@xxxxxxxxxxxxxxx, Sven Eckelmann <sven@xxxxxxxxxxxxx>, Alex Elder <aelder@xxxxxxx>, xfs-masters@xxxxxxxxxxx, xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=mail; t=1311760126; bh=ZKWdvPv1cPNDD5rgmySo9n/OVDyVt88wm0Pa+G4p04o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=IfegHmhHZE4Ym7ZbMaOLU9rn1OU1mxp/8hIKNpobRneEYmUHlgelpTCsN1SytdC1G SNVC9xHgjeMMyr6Eq0Ug0e/wDaQuWafN6NrMCcV+SyCVjyVNkpB9kfVkMM/GJa0/kL ilEVP0WhYTual0ETQyereNRMtGcMlX84S9+lQkPo=
In-reply-to: <1311760070-21532-1-git-send-email-sven@xxxxxxxxxxxxx>
References: <1311760070-21532-1-git-send-email-sven@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx>
Cc: Alex Elder <aelder@xxxxxxx>
Cc: xfs-masters@xxxxxxxxxxx
Cc: xfs@xxxxxxxxxxx
---
 fs/xfs/linux-2.6/xfs_buf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index b2b4119..a68d9bf 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1429,7 +1429,7 @@ xfs_buftarg_shrink(
                 * zero. If the value is already zero, we need to reclaim the
                 * buffer, otherwise it gets another trip through the LRU.
                 */
-               if (!atomic_add_unless(&bp->b_lru_ref, -1, 0)) {
+               if (!atomic_dec_not_zero(&bp->b_lru_ref)) {
                        list_move_tail(&bp->b_lru, &btp->bt_lru);
                        continue;
                }
-- 
1.7.5.4

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCHv4 08/11] xfs: Use *_dec_not_zero instead of *_add_unless, Sven Eckelmann <=