summaryrefslogtreecommitdiff
path: root/lib/iovec.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-10 16:03:43 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-02-04 01:34:16 -0500
commit57dd8a0735aabff4862025cf64ad94da3d80e620 (patch)
tree6cce47f1276bc51e1eb29e8cd623e78102ff4c6a /lib/iovec.c
parentba7438aed924133df54a60e4cd5499d359bcf2a8 (diff)
downloadlwn-57dd8a0735aabff4862025cf64ad94da3d80e620.tar.gz
lwn-57dd8a0735aabff4862025cf64ad94da3d80e620.zip
vhost: vhost_scsi_handle_vq() should just use copy_from_user()
it has just verified that it asks no more than the length of the first segment of iovec. And with that the last user of stuff in lib/iovec.c is gone. RIP. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Nicholas A. Bellinger <nab@linux-iscsi.org> Cc: kvm@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'lib/iovec.c')
-rw-r--r--lib/iovec.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/iovec.c b/lib/iovec.c
deleted file mode 100644
index d8f17a9b1ccf..000000000000
--- a/lib/iovec.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <linux/uaccess.h>
-#include <linux/export.h>
-#include <linux/uio.h>
-
-/*
- * Copy iovec to kernel. Returns -EFAULT on error.
- */
-
-int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
- int offset, int len)
-{
- /* No data? Done! */
- if (len == 0)
- return 0;
-
- /* Skip over the finished iovecs */
- while (offset >= iov->iov_len) {
- offset -= iov->iov_len;
- iov++;
- }
-
- while (len > 0) {
- u8 __user *base = iov->iov_base + offset;
- int copy = min_t(unsigned int, len, iov->iov_len - offset);
-
- offset = 0;
- if (copy_from_user(kdata, base, copy))
- return -EFAULT;
- len -= copy;
- kdata += copy;
- iov++;
- }
-
- return 0;
-}
-EXPORT_SYMBOL(memcpy_fromiovecend);