summaryrefslogtreecommitdiffstats
path: root/block/blk-map.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-03-29 16:52:15 +0200
committerJens Axboe <axboe@kernel.dk>2023-03-30 16:12:29 +0200
commitde4f5fed3f231a8ff4790bf52975f847b95b85ea (patch)
tree0f546e08dadb0145ca9347ce3fc2b8936d48c5f6 /block/blk-map.c
parentblock: ensure bio_alloc_map_data() deals with ITER_UBUF correctly (diff)
downloadlinux-de4f5fed3f231a8ff4790bf52975f847b95b85ea.tar.xz
linux-de4f5fed3f231a8ff4790bf52975f847b95b85ea.zip
iov_iter: add iter_iovec() helper
This returns a pointer to the current iovec entry in the iterator. Only useful with ITER_IOVEC right now, but it prepares us to treat ITER_UBUF and ITER_IOVEC identically for the first segment. Rename struct iov_iter->iov to iov_iter->__iov to find any potentially troublesome spots, and also to prevent anyone from adding new code that accesses iter->iov directly. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-map.c')
-rw-r--r--block/blk-map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index 3bfcad64d67c..04c55f1c492e 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -31,8 +31,8 @@ static struct bio_map_data *bio_alloc_map_data(struct iov_iter *data,
return NULL;
bmd->iter = *data;
if (iter_is_iovec(data)) {
- memcpy(bmd->iov, data->iov, sizeof(struct iovec) * data->nr_segs);
- bmd->iter.iov = bmd->iov;
+ memcpy(bmd->iov, iter_iov(data), sizeof(struct iovec) * data->nr_segs);
+ bmd->iter.__iov = bmd->iov;
}
return bmd;
}