mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
block: remove the bi_phys_segments field in struct bio
We only need the number of segments in the blk-mq submission path. Remove the field from struct bio, and return it from a variant of blk_queue_split instead of that it can passed as an argument to those functions that need the value. This also means we stop recounting segments except for cloning and partial segments. To keep the number of arguments in this how path down remove pointless struct request_queue arguments from any of the functions that had it and grew a nr_segs argument. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
f924cddebc
commit
14ccb66b3f
18 changed files with 106 additions and 137 deletions
|
|
@ -18,13 +18,19 @@
|
|||
int blk_rq_append_bio(struct request *rq, struct bio **bio)
|
||||
{
|
||||
struct bio *orig_bio = *bio;
|
||||
struct bvec_iter iter;
|
||||
struct bio_vec bv;
|
||||
unsigned int nr_segs = 0;
|
||||
|
||||
blk_queue_bounce(rq->q, bio);
|
||||
|
||||
bio_for_each_bvec(bv, *bio, iter)
|
||||
nr_segs++;
|
||||
|
||||
if (!rq->bio) {
|
||||
blk_rq_bio_prep(rq->q, rq, *bio);
|
||||
blk_rq_bio_prep(rq, *bio, nr_segs);
|
||||
} else {
|
||||
if (!ll_back_merge_fn(rq->q, rq, *bio)) {
|
||||
if (!ll_back_merge_fn(rq, *bio, nr_segs)) {
|
||||
if (orig_bio != *bio) {
|
||||
bio_put(*bio);
|
||||
*bio = orig_bio;
|
||||
|
|
|
|||
Loading…
Reference in a new issue