@@ -174,12 +174,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;
@@ -288,7 +286,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) {
Pass the start sector instead of the whole bio. Signed-off-by: Christoph Hellwig <hch@lst.de> --- block/blk-merge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)