On 1/19/22 6:21 PM, Darrick J. Wong wrote:
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.
Ok, this is in preparation for later adding more to the function (saying "set it correctly" confused me a little, because the function looks equivalent to the macro....) ...
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);
This *looks* a little like a functional change, since you dropped setting of the bp->b_maps[0].bm_bn. But since we get here with a single buffer, not a map of buffers, I ... think that at this point, nobody will be looking at b_maps[0].bm_bn anyway? But I'm not quite sure. I also notice xfs_get_aghdr_buf() in the kernel setting both b_bn and b_maps[0].bm_bn upstream, for similar purposes. Can you sanity-check me a little here? Thanks, -Eric
return bp; }