From: Christoph Hellwig Date: Thu, 6 Jun 2019 10:29:03 +0000 (+0200) Subject: block: untangle the end of blk_bio_segment_split X-Git-Tag: v5.4-rc1~640^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d627065d88469933bc1527f97c539c464482f0bb;p=platform%2Fkernel%2Flinux-rpi.git block: untangle the end of blk_bio_segment_split Now that we don't need to assign the front/back segment sizes, we can duplicating the segs assignment for the split vs no-split case and remove a whole chunk of boilerplate code. Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe --- diff --git a/block/blk-merge.c b/block/blk-merge.c index 2ea21ff..ca45eb5 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -202,8 +202,6 @@ 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; - bool do_split = true; - struct bio *new = NULL; const unsigned max_sectors = get_max_io_size(q, bio); const unsigned max_segs = queue_max_segments(q); @@ -245,17 +243,11 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, } } - do_split = false; + *segs = nsegs; + return NULL; split: *segs = nsegs; - - if (do_split) { - new = bio_split(bio, sectors, GFP_NOIO, bs); - if (new) - bio = new; - } - - return do_split ? new : NULL; + return bio_split(bio, sectors, GFP_NOIO, bs); } void __blk_queue_split(struct request_queue *q, struct bio **bio,