Skip to content

Commit 218321e

Browse files
author
Al Viro
committed
bury memcpy_toiovec()
no users left Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent d3a9632 commit 218321e

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

include/linux/uio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ size_t csum_and_copy_to_iter(void *addr, size_t bytes, __wsum *csum, struct iov_
131131
size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
132132

133133
int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
134-
int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len);
135134
int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
136135
int offset, int len);
137136
int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,

lib/iovec.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,6 @@ int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len)
2727
}
2828
EXPORT_SYMBOL(memcpy_fromiovec);
2929

30-
/*
31-
* Copy kernel to iovec. Returns -EFAULT on error.
32-
*
33-
* Note: this modifies the original iovec.
34-
*/
35-
36-
int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
37-
{
38-
while (len > 0) {
39-
if (iov->iov_len) {
40-
int copy = min_t(unsigned int, iov->iov_len, len);
41-
if (copy_to_user(iov->iov_base, kdata, copy))
42-
return -EFAULT;
43-
kdata += copy;
44-
len -= copy;
45-
iov->iov_len -= copy;
46-
iov->iov_base += copy;
47-
}
48-
iov++;
49-
}
50-
51-
return 0;
52-
}
53-
EXPORT_SYMBOL(memcpy_toiovec);
54-
5530
/*
5631
* Copy kernel to iovec. Returns -EFAULT on error.
5732
*/

0 commit comments

Comments
 (0)