mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02: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:
@@ -503,10 +503,10 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec,
|
||||
if (!iovec) {
|
||||
unsigned iov_off = 0;
|
||||
|
||||
io->s.iter.iov = io->s.fast_iov;
|
||||
if (iter->iov != fast_iov) {
|
||||
iov_off = iter->iov - fast_iov;
|
||||
io->s.iter.iov += iov_off;
|
||||
io->s.iter.__iov = io->s.fast_iov;
|
||||
if (iter->__iov != fast_iov) {
|
||||
iov_off = iter_iov(iter) - fast_iov;
|
||||
io->s.iter.__iov += iov_off;
|
||||
}
|
||||
if (io->s.fast_iov != fast_iov)
|
||||
memcpy(io->s.fast_iov + iov_off, fast_iov + iov_off,
|
||||
|
Reference in New Issue
Block a user