[PATCHv2 5/5] xfs: kill off l_sectbb_mask

Christoph Hellwig hch at infradead.org
Sun Apr 18 12:21:21 CDT 2010


On Fri, Apr 16, 2010 at 03:54:05PM -0500, Alex Elder wrote:
> -	uint			l_sectBBsize;   /* sector size in BBs */
> -	uint			l_sectbb_mask;  /* sector size (in BBs)
> -						 * alignment mask */
> +	uint			l_sectBBsize;   /* sector size in BBs (2^n) */

The 2^n comment doesn't make too much sense to me.

But in general looks good, nice cleanup.


Signed-off-by: Christoph Hellwig <hch at lst.de>

> @@ -128,14 +132,14 @@ xlog_align(
>  	int		nbblks,
>  	xfs_buf_t	*bp)
>  {
> +	xfs_daddr_t	offset;
>  	xfs_caddr_t	ptr;
>  
> -	if (log->l_sectBBsize == 1)
> -		return XFS_BUF_PTR(bp);
> +	offset = blk_no & ((xfs_daddr_t) log->l_sectBBsize - 1);
> +	ptr = XFS_BUF_PTR(bp) + BBTOB(offset);
> +
> +	ASSERT(ptr + BBTOB(nbblks) <= XFS_BUF_PTR(bp) + XFS_BUF_SIZE(bp));

And Dave's version of this assert definitively makes a lot more sense,
this is one while evolved from the previous one is rather ugly.




More information about the xfs mailing list