From 705e23856c6889c81b354ef8672f308ffd586d33 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 10 Sep 2021 13:50:50 +0200 Subject: [PATCH] block: pass the start sector to get_max_io_size Pass the start sector instead of the whole bio. Signed-off-by: Christoph Hellwig --- block/blk-merge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index e3ed935e37cf..b1cc6f392ad6 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -142,12 +142,10 @@ static struct bio *blk_bio_write_same_split(struct request_queue *q, * requests that are submitted to a block device if the start of a bio is not * aligned to a physical block boundary. */ -static inline unsigned get_max_io_size(struct request_queue *q, - struct bio *bio) +static inline unsigned get_max_io_size(struct request_queue *q, sector_t sector) { unsigned pbs = queue_physical_block_size(q) >> SECTOR_SHIFT; unsigned lbs = queue_logical_block_size(q) >> SECTOR_SHIFT; - sector_t sector = bio->bi_iter.bi_sector; unsigned start_offset = sector & (pbs - 1); unsigned sectors = q->limits.max_sectors; unsigned max_sectors; @@ -255,7 +253,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, struct bio_vec bv, bvprv, *bvprvp = NULL; struct bvec_iter iter; unsigned nsegs = 0, sectors = 0; - const unsigned max_sectors = get_max_io_size(q, bio); + const unsigned max_sectors = get_max_io_size(q, bio->bi_iter.bi_sector); const unsigned max_segs = queue_max_segments(q); bio_for_each_bvec(bv, bio, iter) { -- 2.50.1