From: Darrick J. Wong <djwong@xxxxxxxxxx> Replace XFS_BUF_SET_ADDR with a new function that will set the buffer block number correctly, then port the two users to it. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- libxfs/libxfs_io.h | 5 ++++- libxlog/xfs_log_recover.c | 2 +- mkfs/xfs_mkfs.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h index 3cc4f4ee..bf489259 100644 --- a/libxfs/libxfs_io.h +++ b/libxfs/libxfs_io.h @@ -116,7 +116,10 @@ typedef unsigned int xfs_buf_flags_t; #define xfs_buf_offset(bp, offset) ((bp)->b_addr + (offset)) #define XFS_BUF_ADDR(bp) ((bp)->b_bn) -#define XFS_BUF_SET_ADDR(bp,blk) ((bp)->b_bn = (blk)) +static inline void xfs_buf_set_daddr(struct xfs_buf *bp, xfs_daddr_t blkno) +{ + bp->b_bn = blkno; +} void libxfs_buf_set_priority(struct xfs_buf *bp, int priority); int libxfs_buf_priority(struct xfs_buf *bp); diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c index d43914b9..3c24c021 100644 --- a/libxlog/xfs_log_recover.c +++ b/libxlog/xfs_log_recover.c @@ -114,7 +114,7 @@ xlog_bread_noalign( ASSERT(nbblks > 0); ASSERT(nbblks <= bp->b_length); - XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); + xfs_buf_set_daddr(bp, log->l_logBBstart + blk_no); bp->b_length = nbblks; bp->b_error = 0; diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 63895f28..057b3b09 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3505,8 +3505,8 @@ alloc_write_buf( error); exit(1); } - bp->b_bn = daddr; - bp->b_maps[0].bm_bn = daddr; + + xfs_buf_set_daddr(bp, daddr); return bp; }