]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: remove xfs_buf.b_offset
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Mar 2025 13:19:06 +0000 (14:19 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 10 Mar 2025 13:29:44 +0000 (14:29 +0100)
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 <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h

index ba0bdff3ad5742b3bae8a2b517bfddde6f7bac7a..972ea34ecfd477382138267e90431ca0d9bb8f78 100644 (file)
@@ -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);
index 80e06eecaf56ed139aeeff525365e0fa25348a84..c92a328252cc1ae6d6dd03adb88a75285806c09a 100644 (file)
@@ -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);