From: Christoph Hellwig Date: Mon, 10 Mar 2025 13:19:06 +0000 (+0100) Subject: xfs: remove xfs_buf.b_offset X-Git-Tag: v6.15-rc1~149^2~6^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e10993153adc14e8caf2a13d6defc8403dfb4c;p=thirdparty%2Flinux.git xfs: remove xfs_buf.b_offset b_offset is only set for slab backed buffers and always set to offset_in_page(bp->b_addr), which can be done just as easily in the only user of b_offset. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index ba0bdff3ad574..972ea34ecfd47 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -278,7 +278,6 @@ xfs_buf_alloc_kmem( bp->b_addr = NULL; return -ENOMEM; } - bp->b_offset = offset_in_page(bp->b_addr); bp->b_pages = bp->b_page_array; bp->b_pages[0] = kmem_to_page(bp->b_addr); bp->b_page_count = 1; @@ -1474,7 +1473,7 @@ xfs_buf_submit_bio( if (bp->b_flags & _XBF_KMEM) { __bio_add_page(bio, virt_to_page(bp->b_addr), size, - bp->b_offset); + offset_in_page(bp->b_addr)); } else { for (p = 0; p < bp->b_page_count; p++) __bio_add_page(bio, bp->b_pages[p], PAGE_SIZE, 0); diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 80e06eecaf56e..c92a328252cc1 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -194,8 +194,6 @@ struct xfs_buf { int b_map_count; atomic_t b_pin_count; /* pin count */ unsigned int b_page_count; /* size of page array */ - unsigned int b_offset; /* page offset of b_addr, - only for _XBF_KMEM buffers */ int b_error; /* error code on I/O */ void (*b_iodone)(struct xfs_buf *bp);