[Top] [All Lists]

Re: [PATCH 2/3] xfs: use generic per-cpu counter infrastructure

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/3] xfs: use generic per-cpu counter infrastructure
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 16 Dec 2010 10:36:34 -0500
Cc: xfs@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, a.p.zijlstra@xxxxxxxxx
In-reply-to: <1292203313-15570-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1292203313-15570-1-git-send-email-david@xxxxxxxxxxxxx> <1292203313-15570-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Dec 13, 2010 at 12:21:52PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> XFS has a per-cpu counter implementation for in-core superblock
> counters that pre-dated the generic implementation. It is complex
> and baroque as it is tailored directly to the needs of ENOSPC
> detection.
> Now that the generic percpu counter infrastructure has the
> percpu_counter_add_unless_lt() function that implements the
> necessary threshold checks for us, switch the XFS per-cpu
> superblock counters to use the generic percpu counter
> infrastructure.
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>

Looks good to me,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

A little nipick:

> -#ifdef HAVE_PERCPU_SB
>       ASSERT(field < XFS_SBS_ICOUNT || field > XFS_SBS_FDBLOCKS);
> -#endif

No need to keep this assert - xfs_mod_incore_sb_unlocked already
has one for unknown fields.

<Prev in Thread] Current Thread [Next in Thread>