Re: [PATCH 07/13] xfs_repair: Remove BUF_PTR from attr_repair.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 09, 2015 at 02:34:05PM -0500, Eric Sandeen wrote:
> The BUF_PTR macro was removed from kernelspace a while ago
> (6292604 xfs: Remove the macro XFS_BUF_PTR) but it lives
> on in some parts of xfsprogs.  dir2.c doesn't use it,
> but similar code in attr_repair.c does.  remove it from
> attr_repair.c to converge the code.
> 
> Remove a related but unnecessary cast from a *void b_addr
> in dir2.c while we're at it.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  repair/attr_repair.c |   12 ++++++------
>  repair/dir2.c        |    2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/repair/attr_repair.c b/repair/attr_repair.c
> index fe81df4..5ae2356 100644
> --- a/repair/attr_repair.c
> +++ b/repair/attr_repair.c
> @@ -188,7 +188,7 @@ traverse_int_dablock(xfs_mount_t	*mp,
>  			goto error_out;
>  		}
>  
> -		node = (xfs_da_intnode_t *)XFS_BUF_PTR(bp);
> +		node = bp->b_addr;
>  		btree = M_DIROPS(mp)->node_tree_p(node);
>  		M_DIROPS(mp)->node_hdr_from_disk(&nodehdr, node);
>  
> @@ -335,7 +335,7 @@ verify_final_da_path(xfs_mount_t	*mp,
>  	 * in the block which should be the final (rightmost) entry
>  	 */
>  	entry = cursor->level[this_level].index;
> -	node = (xfs_da_intnode_t *)XFS_BUF_PTR(cursor->level[this_level].bp);
> +	node = cursor->level[this_level].bp->b_addr;
>  	btree = M_DIROPS(mp)->node_tree_p(node);
>  	M_DIROPS(mp)->node_hdr_from_disk(&nodehdr, node);
>  
> @@ -513,7 +513,7 @@ verify_da_path(xfs_mount_t	*mp,
>  	 * should be processed now in this level.
>  	 */
>  	entry = cursor->level[this_level].index;
> -	node = (xfs_da_intnode_t *)XFS_BUF_PTR(cursor->level[this_level].bp);
> +	node = cursor->level[this_level].bp->b_addr;
>  	btree = M_DIROPS(mp)->node_tree_p(node);
>  	M_DIROPS(mp)->node_hdr_from_disk(&nodehdr, node);
>  
> @@ -571,7 +571,7 @@ _("can't get map info for block %u of directory inode %" PRIu64 "\n"),
>  			return(1);
>  		}
>  
> -		newnode = (xfs_da_intnode_t *)XFS_BUF_PTR(bp);
> +		newnode = bp->b_addr;
>  		btree = M_DIROPS(mp)->node_tree_p(newnode);
>  		M_DIROPS(mp)->node_hdr_from_disk(&nodehdr, newnode);
>  
> @@ -1040,7 +1040,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
>  		ASSERT(mp->m_sb.sb_blocksize == XFS_BUF_COUNT(bp));
>  
>  		length = MIN(XFS_BUF_COUNT(bp) - hdrsize, valuelen - amountdone);
> -		memmove(value, XFS_BUF_PTR(bp) + hdrsize, length);
> +		memmove(value, bp->b_addr + hdrsize, length);
>  		amountdone += length;
>  		value += length;
>  		i++;
> @@ -1620,7 +1620,7 @@ process_longform_attr(
>  	}
>  
>  	/* verify leaf block */
> -	leaf = (xfs_attr_leafblock_t *)XFS_BUF_PTR(bp);
> +	leaf = bp->b_addr;
>  	xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf);
>  
>  	/* check sibling pointers in leaf block or root block 0 before
> diff --git a/repair/dir2.c b/repair/dir2.c
> index d9bd5fc..9398df5 100644
> --- a/repair/dir2.c
> +++ b/repair/dir2.c
> @@ -347,7 +347,7 @@ verify_final_dir2_path(xfs_mount_t	*mp,
>  	 * in the block which should be the final (rightmost) entry
>  	 */
>  	entry = cursor->level[this_level].index;
> -	node = (xfs_da_intnode_t *)(cursor->level[this_level].bp->b_addr);
> +	node = cursor->level[this_level].bp->b_addr;
>  	btree = M_DIROPS(mp)->node_tree_p(node);
>  	M_DIROPS(mp)->node_hdr_from_disk(&nodehdr, node);
>  
> -- 
> 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux