diff options
Diffstat (limited to 'lib/iovec.c')
-rw-r--r-- | lib/iovec.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/iovec.c b/lib/iovec.c index 4a90875c64ae..d8f17a9b1ccf 100644 --- a/lib/iovec.c +++ b/lib/iovec.c | |||
@@ -3,32 +3,6 @@ | |||
3 | #include <linux/uio.h> | 3 | #include <linux/uio.h> |
4 | 4 | ||
5 | /* | 5 | /* |
6 | * Copy kernel to iovec. Returns -EFAULT on error. | ||
7 | */ | ||
8 | |||
9 | int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, | ||
10 | int offset, int len) | ||
11 | { | ||
12 | int copy; | ||
13 | for (; len > 0; ++iov) { | ||
14 | /* Skip over the finished iovecs */ | ||
15 | if (unlikely(offset >= iov->iov_len)) { | ||
16 | offset -= iov->iov_len; | ||
17 | continue; | ||
18 | } | ||
19 | copy = min_t(unsigned int, iov->iov_len - offset, len); | ||
20 | if (copy_to_user(iov->iov_base + offset, kdata, copy)) | ||
21 | return -EFAULT; | ||
22 | offset = 0; | ||
23 | kdata += copy; | ||
24 | len -= copy; | ||
25 | } | ||
26 | |||
27 | return 0; | ||
28 | } | ||
29 | EXPORT_SYMBOL(memcpy_toiovecend); | ||
30 | |||
31 | /* | ||
32 | * Copy iovec to kernel. Returns -EFAULT on error. | 6 | * Copy iovec to kernel. Returns -EFAULT on error. |
33 | */ | 7 | */ |
34 | 8 | ||