Skip to content

Commit 200a9af

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the segment size check in bio_will_gap
We fundamentally do not have a maximum segement size for devices with a virt boundary. So don't bother checking it, especially given that the existing checks didn't properly work to start with as we never fully update the front/back segment size and miss the bi_seg_front_size that wuld have been required for some cases. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 09324d3 commit 200a9af

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

block/blk-merge.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,6 @@
1212

1313
#include "blk.h"
1414

15-
/*
16-
* Check if the two bvecs from two bios can be merged to one segment. If yes,
17-
* no need to check gap between the two bios since the 1st bio and the 1st bvec
18-
* in the 2nd bio can be handled in one segment.
19-
*/
20-
static inline bool bios_segs_mergeable(struct request_queue *q,
21-
struct bio *prev, struct bio_vec *prev_last_bv,
22-
struct bio_vec *next_first_bv)
23-
{
24-
if (!biovec_phys_mergeable(q, prev_last_bv, next_first_bv))
25-
return false;
26-
if (prev->bi_seg_back_size + next_first_bv->bv_len >
27-
queue_max_segment_size(q))
28-
return false;
29-
return true;
30-
}
31-
3215
static inline bool bio_will_gap(struct request_queue *q,
3316
struct request *prev_rq, struct bio *prev, struct bio *next)
3417
{
@@ -60,7 +43,7 @@ static inline bool bio_will_gap(struct request_queue *q,
6043
*/
6144
bio_get_last_bvec(prev, &pb);
6245
bio_get_first_bvec(next, &nb);
63-
if (bios_segs_mergeable(q, prev, &pb, &nb))
46+
if (biovec_phys_mergeable(q, &pb, &nb))
6447
return false;
6548
return __bvec_gap_to_prev(q, &pb, nb.bv_offset);
6649
}

0 commit comments

Comments
 (0)