Skip to content

Commit 51e1099

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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 <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent f2a3717 commit 51e1099

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

fs/xfs/xfs_buf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ xfs_buf_alloc_kmem(
278278
bp->b_addr = NULL;
279279
return -ENOMEM;
280280
}
281-
bp->b_offset = offset_in_page(bp->b_addr);
282281
bp->b_pages = bp->b_page_array;
283282
bp->b_pages[0] = kmem_to_page(bp->b_addr);
284283
bp->b_page_count = 1;
@@ -1474,7 +1473,7 @@ xfs_buf_submit_bio(
14741473

14751474
if (bp->b_flags & _XBF_KMEM) {
14761475
__bio_add_page(bio, virt_to_page(bp->b_addr), size,
1477-
bp->b_offset);
1476+
offset_in_page(bp->b_addr));
14781477
} else {
14791478
for (p = 0; p < bp->b_page_count; p++)
14801479
__bio_add_page(bio, bp->b_pages[p], PAGE_SIZE, 0);

fs/xfs/xfs_buf.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ struct xfs_buf {
194194
int b_map_count;
195195
atomic_t b_pin_count; /* pin count */
196196
unsigned int b_page_count; /* size of page array */
197-
unsigned int b_offset; /* page offset of b_addr,
198-
only for _XBF_KMEM buffers */
199197
int b_error; /* error code on I/O */
200198
void (*b_iodone)(struct xfs_buf *bp);
201199

0 commit comments

Comments
 (0)