xfs
[Top] [All Lists]

Re: [PATCH 07/12] xfs: Remove the macro XFS_BUF_PTR

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH 07/12] xfs: Remove the macro XFS_BUF_PTR
From: Alex Elder <aelder@xxxxxxx>
Date: Fri, 22 Jul 2011 14:38:26 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <20110722003322.21069.83785.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20110722003226.21069.58401.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110722003322.21069.83785.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: <aelder@xxxxxxx>
On Thu, 2011-07-21 at 17:33 -0700, Chandra Seetharaman wrote:
> Remove the definition and usages of the macro XFS_BUF_PTR.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

This looks fine.  One little comment below but it's
really more like a rhetorical question (or statement).
Well done.

Reviewed-by: Alex Elder <aelder@xxxxxxx>

> diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
> index ae2c2e7..6a42f71 100644
> --- a/fs/xfs/linux-2.6/xfs_buf.c
> +++ b/fs/xfs/linux-2.6/xfs_buf.c
> @@ -1320,7 +1320,7 @@ xfs_buf_offset(
>       struct page             *page;
>  
>       if (bp->b_flags & XBF_MAPPED)
> -             return XFS_BUF_PTR(bp) + offset;
> +             return bp->b_addr + offset;

I guess we're using GCC-isms elsewhere (including
possibly this one) so I suppose using arithmetic
on a void pointer is OK.  In any case it looks
nicer this way...

>  
>       offset += bp->b_offset;
>       page = bp->b_pages[offset >> PAGE_SHIFT];
> diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
> index 6758697..6ae7bde 100644
> --- a/fs/xfs/linux-2.6/xfs_buf.h
> +++ b/fs/xfs/linux-2.6/xfs_buf.h

. . .

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