xfs
[Top] [All Lists]

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

To: aelder@xxxxxxx
Subject: Re: [PATCH 09/12] Replace the macro XFS_BUF_ISPINNED with helper xfs_buf_ispinned
From: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Date: Fri, 22 Jul 2011 13:51:13 -0700
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1311363514.2771.104.camel@doink>
Organization: IBM
References: <20110722003226.21069.58401.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110722003343.21069.95122.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <1311363514.2771.104.camel@doink>
Reply-to: sekharan@xxxxxxxxxx
On Fri, 2011-07-22 at 14:38 -0500, Alex Elder wrote:
> 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);

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


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