diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-09-24 12:30:17 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-10-11 17:23:42 -0400 |
commit | 0a0f151364f5bf836ad1d4de6113adb103a6628c (patch) | |
tree | 10a71f8464ff0d9f8ba1f1c9e1edbff8971652ed | |
parent | 98a09d6106660ec6e69ff2a6fa14039bd504412b (diff) | |
download | blackbird-obmc-linux-0a0f151364f5bf836ad1d4de6113adb103a6628c.tar.gz blackbird-obmc-linux-0a0f151364f5bf836ad1d4de6113adb103a6628c.zip |
bio_map_user_iov(): get rid of copying iov_iter
we do want *iter advanced
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | block/bio.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/block/bio.c b/block/bio.c index f5002b44c963..28f66e2edc53 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1333,7 +1333,6 @@ struct bio *bio_map_user_iov(struct request_queue *q, int j; struct bio *bio; int ret; - struct iov_iter i; struct bio_vec *bvec; if (!iov_iter_count(iter)) @@ -1343,14 +1342,13 @@ struct bio *bio_map_user_iov(struct request_queue *q, if (!bio) return ERR_PTR(-ENOMEM); - i = *iter; - while (iov_iter_count(&i)) { + while (iov_iter_count(iter)) { struct page **pages; ssize_t bytes; size_t offs, added = 0; int npages; - bytes = iov_iter_get_pages_alloc(&i, &pages, LONG_MAX, &offs); + bytes = iov_iter_get_pages_alloc(iter, &pages, LONG_MAX, &offs); if (unlikely(bytes <= 0)) { ret = bytes ? bytes : -EFAULT; goto out_unmap; @@ -1384,7 +1382,7 @@ struct bio *bio_map_user_iov(struct request_queue *q, bytes -= n; offs = 0; } - iov_iter_advance(&i, added); + iov_iter_advance(iter, added); } /* * release the pages we didn't map into the bio, if any @@ -1406,7 +1404,6 @@ struct bio *bio_map_user_iov(struct request_queue *q, * reference to it */ bio_get(bio); - iov_iter_advance(iter, bio->bi_iter.bi_size); return bio; out_unmap: |