[PATCH 09/12] Replace the macro XFS_BUF_ISPINNED with helper xfs_buf_ispinned
Chandra Seetharaman
sekharan at us.ibm.com
Fri Jul 22 15:51:13 CDT 2011
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 at us.ibm.com>
> > Reviewed-by: Christoph Hellwig <hch at lst.de>
>
> One simple suggestion below. Otherwise:
>
> Reviewed-by: Alex Elder <aelder at sgi.com>
>
> > 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);
> >
>
>
More information about the xfs
mailing list