projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6eb203e
)
iov_iter: set nr_segs = 1 for ITER_UBUF
author
Jens Axboe
<axboe@kernel.dk>
Tue, 28 Mar 2023 20:29:03 +0000
(14:29 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 30 Mar 2023 14:12:29 +0000
(08:12 -0600)
To avoid needing to check if a given user backed iov_iter is of type
ITER_IOVEC or ITER_UBUF, set the number of segments for the ITER_UBUF
case to 1 as we're carrying a single segment.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/uio.h
patch
|
blob
|
history
diff --git
a/include/linux/uio.h
b/include/linux/uio.h
index 7f585ceedcb241fd6e6d26257780d01d500b006b..5dbd2dcab35c8faafef9f3b7cebf007fc1438d46 100644
(file)
--- a/
include/linux/uio.h
+++ b/
include/linux/uio.h
@@
-355,7
+355,8
@@
static inline void iov_iter_ubuf(struct iov_iter *i, unsigned int direction,
.user_backed = true,
.data_source = direction,
.ubuf = buf,
- .count = count
+ .count = count,
+ .nr_segs = 1
};
}
/* Flags for iov_iter_get/extract_pages*() */