summaryrefslogtreecommitdiff
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-09-25 06:51:41 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2020-10-03 00:02:13 -0400
commit89cd35c58bc2e36bfdc23dde67a429b08cf4ae03 (patch)
tree540a413bab63b20e24dba2dece0044277bb778a1 /fs/read_write.c
parentbfdc59701d6d100c99c3b987bcffd1c204e393c8 (diff)
downloadlwn-89cd35c58bc2e36bfdc23dde67a429b08cf4ae03.tar.gz
lwn-89cd35c58bc2e36bfdc23dde67a429b08cf4ae03.zip
iov_iter: transparently handle compat iovecs in import_iovec
Use in compat_syscall to import either native or the compat iovecs, and remove the now superflous compat_import_iovec. This removes the need for special compat logic in most callers, and the remaining ones can still be simplified by using __import_iovec with a bool compat parameter. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index e5e891a88442..0a68037580b4 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1078,7 +1078,8 @@ static size_t compat_readv(struct file *file,
struct iov_iter iter;
ssize_t ret;
- ret = compat_import_iovec(READ, vec, vlen, UIO_FASTIOV, &iov, &iter);
+ ret = import_iovec(READ, (const struct iovec __user *)vec, vlen,
+ UIO_FASTIOV, &iov, &iter);
if (ret >= 0) {
ret = do_iter_read(file, &iter, pos, flags);
kfree(iov);
@@ -1186,7 +1187,8 @@ static size_t compat_writev(struct file *file,
struct iov_iter iter;
ssize_t ret;
- ret = compat_import_iovec(WRITE, vec, vlen, UIO_FASTIOV, &iov, &iter);
+ ret = import_iovec(WRITE, (const struct iovec __user *)vec, vlen,
+ UIO_FASTIOV, &iov, &iter);
if (ret >= 0) {
file_start_write(file);
ret = do_iter_write(file, &iter, pos, flags);