mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user