|
12 | 12 |
|
13 | 13 | #include "blk.h"
|
14 | 14 |
|
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 |
| - |
32 | 15 | static inline bool bio_will_gap(struct request_queue *q,
|
33 | 16 | struct request *prev_rq, struct bio *prev, struct bio *next)
|
34 | 17 | {
|
@@ -60,7 +43,7 @@ static inline bool bio_will_gap(struct request_queue *q,
|
60 | 43 | */
|
61 | 44 | bio_get_last_bvec(prev, &pb);
|
62 | 45 | bio_get_first_bvec(next, &nb);
|
63 |
| - if (bios_segs_mergeable(q, prev, &pb, &nb)) |
| 46 | + if (biovec_phys_mergeable(q, &pb, &nb)) |
64 | 47 | return false;
|
65 | 48 | return __bvec_gap_to_prev(q, &pb, nb.bv_offset);
|
66 | 49 | }
|
|
0 commit comments