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