lkml.org 
[lkml]   [2017]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 14/14] xfs: use atomic_dec_not_zero()
On Mon, Jan 30, 2017 at 07:48:44PM +0100, Fabian Frederick wrote:
> instead of atomic_add_unless(value, -1, 0)
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
> fs/xfs/xfs_buf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index ac3b4db..51b2167 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1684,7 +1684,7 @@ xfs_buftarg_isolate(
> * 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)) {

Hard to tell if this is correct, since there's no atomic_dec_not_zero
defined in any of my kernel trees' include/ headers and I haven't seen a
patch adding such a symbol appear on this list. Did you hoist the
lib/fault-inject.c definition or something?

--D

> spin_unlock(&bp->b_lock);
> return LRU_ROTATE;
> }
> --
> 2.9.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

\
 
 \ /
  Last update: 2017-01-31 01:32    [W:0.169 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site