diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-25 06:51:41 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-10-03 00:02:13 -0400 |
commit | 89cd35c58bc2e36bfdc23dde67a429b08cf4ae03 (patch) | |
tree | 540a413bab63b20e24dba2dece0044277bb778a1 /lib/iov_iter.c | |
parent | bfdc59701d6d100c99c3b987bcffd1c204e393c8 (diff) |
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 'lib/iov_iter.c')
-rw-r--r-- | lib/iov_iter.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c index e6cb51da3424..2e452ce7388b 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1806,21 +1806,11 @@ ssize_t import_iovec(int type, const struct iovec __user *uvec, unsigned nr_segs, unsigned fast_segs, struct iovec **iovp, struct iov_iter *i) { - return __import_iovec(type, uvec, nr_segs, fast_segs, iovp, i, false); + return __import_iovec(type, uvec, nr_segs, fast_segs, iovp, i, + in_compat_syscall()); } EXPORT_SYMBOL(import_iovec); -#ifdef CONFIG_COMPAT -ssize_t compat_import_iovec(int type, const struct compat_iovec __user *uvec, - unsigned nr_segs, unsigned fast_segs, struct iovec **iovp, - struct iov_iter *i) -{ - return __import_iovec(type, (const struct iovec __user *)uvec, nr_segs, - fast_segs, iovp, i, true); -} -EXPORT_SYMBOL(compat_import_iovec); -#endif - int import_single_range(int rw, void __user *buf, size_t len, struct iovec *iov, struct iov_iter *i) { |