xfs
[Top] [All Lists]

Re: [PATCH 09/12] Replace the macro XFS_BUF_ISPINNED with helper xfs_buf

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH 09/12] Replace the macro XFS_BUF_ISPINNED with helper xfs_buf_ispinned
From: Alex Elder <aelder@xxxxxxx>
Date: Fri, 22 Jul 2011 14:38:34 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <20110722003343.21069.95122.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20110722003226.21069.58401.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110722003343.21069.95122.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: <aelder@xxxxxxx>
On Thu, 2011-07-21 at 17:33 -0700, Chandra Seetharaman wrote:
> Replace the macro XFS_BUF_ISPINNED with an inline helper function
> xfs_buf_ispinned, and change all its usages.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

One simple suggestion below.  Otherwise:

Reviewed-by: Alex Elder <aelder@xxxxxxx>

> diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
> index 7b1f484..71e1d6f 100644
> --- a/fs/xfs/linux-2.6/xfs_buf.h
> +++ b/fs/xfs/linux-2.6/xfs_buf.h
> @@ -280,7 +280,10 @@ xfs_buf_set_ref(
>  #define XFS_BUF_SET_VTYPE_REF(bp, type, ref) xfs_buf_set_ref(bp, ref)
>  #define XFS_BUF_SET_VTYPE(bp, type)          do { } while (0)
>  
> -#define XFS_BUF_ISPINNED(bp) atomic_read(&((bp)->b_pin_count))
> +static inline int xfs_buf_ispinned(struct xfs_buf *bp)
> +{
> +     return atomic_read(&(bp->b_pin_count));

Good idea.  But drop the extra parentheses:

        return atomic_read(&bp->b_pin_count);

> +}
>  
>  #define XFS_BUF_FINISH_IOWAIT(bp)    complete(&bp->b_iowait);
>  


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