From 2884d0be878eb5cbbc6d983c6054feef3b9aa86d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 24 Sep 2017 12:09:21 -0400 Subject: [PATCH] move more stuff down into bio_copy_user_iov() Signed-off-by: Al Viro --- block/bio.c | 5 +++++ block/blk-map.c | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/block/bio.c b/block/bio.c index cd1282db03cb..02457c2d4379 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1289,6 +1289,9 @@ struct bio *bio_copy_user_iov(struct request_queue *q, if (ret) goto cleanup; + if (map_data) + map_data->offset += bio->bi_iter.bi_size; + /* * success */ @@ -1301,6 +1304,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q, iov_iter_advance(iter, bio->bi_iter.bi_size); bio->bi_private = bmd; + if (map_data && map_data->null_mapped) + bio_set_flag(bio, BIO_NULL_MAPPED); return bio; cleanup: if (!map_data) diff --git a/block/blk-map.c b/block/blk-map.c index 891eea11f68e..c872d62b62fb 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -66,12 +66,6 @@ static int __blk_rq_map_user_iov(struct request *rq, bio->bi_opf &= ~REQ_OP_MASK; bio->bi_opf |= req_op(rq); - if (map_data && map_data->null_mapped) - bio_set_flag(bio, BIO_NULL_MAPPED); - - if (map_data) - map_data->offset += bio->bi_iter.bi_size; - orig_bio = bio; /*