diff options
author | David S. Miller <davem@davemloft.net> | 2013-05-24 19:48:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-24 19:48:28 -0400 |
commit | e6ff4c75f9095f61b3a66c2a78e47b62864022dd (patch) | |
tree | 425ea9463cbec0b1975b8a33d9a56817143055d0 /net/core | |
parent | ee9c799c231324de681eb21e06d8bf4842768b75 (diff) | |
parent | 0e255f1c0c9add2f0c920240ac4cadc28ae274c3 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge net into net-next because some upcoming net-next changes
build on top of bug fixes that went into net.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/iovec.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/net/core/iovec.c b/net/core/iovec.c index 7e7aeb01de45..de178e462682 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c | |||
@@ -75,31 +75,6 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *a | |||
75 | 75 | ||
76 | /* | 76 | /* |
77 | * Copy kernel to iovec. Returns -EFAULT on error. | 77 | * Copy kernel to iovec. Returns -EFAULT on error. |
78 | * | ||
79 | * Note: this modifies the original iovec. | ||
80 | */ | ||
81 | |||
82 | int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len) | ||
83 | { | ||
84 | while (len > 0) { | ||
85 | if (iov->iov_len) { | ||
86 | int copy = min_t(unsigned int, iov->iov_len, len); | ||
87 | if (copy_to_user(iov->iov_base, kdata, copy)) | ||
88 | return -EFAULT; | ||
89 | kdata += copy; | ||
90 | len -= copy; | ||
91 | iov->iov_len -= copy; | ||
92 | iov->iov_base += copy; | ||
93 | } | ||
94 | iov++; | ||
95 | } | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | EXPORT_SYMBOL(memcpy_toiovec); | ||
100 | |||
101 | /* | ||
102 | * Copy kernel to iovec. Returns -EFAULT on error. | ||
103 | */ | 78 | */ |
104 | 79 | ||
105 | int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, | 80 | int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, |
@@ -125,31 +100,6 @@ int memcpy_toiovecend(const struct iovec *iov, unsigned char *kdata, | |||
125 | EXPORT_SYMBOL(memcpy_toiovecend); | 100 | EXPORT_SYMBOL(memcpy_toiovecend); |
126 | 101 | ||
127 | /* | 102 | /* |
128 | * Copy iovec to kernel. Returns -EFAULT on error. | ||
129 | * | ||
130 | * Note: this modifies the original iovec. | ||
131 | */ | ||
132 | |||
133 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len) | ||
134 | { | ||
135 | while (len > 0) { | ||
136 | if (iov->iov_len) { | ||
137 | int copy = min_t(unsigned int, len, iov->iov_len); | ||
138 | if (copy_from_user(kdata, iov->iov_base, copy)) | ||
139 | return -EFAULT; | ||
140 | len -= copy; | ||
141 | kdata += copy; | ||
142 | iov->iov_base += copy; | ||
143 | iov->iov_len -= copy; | ||
144 | } | ||
145 | iov++; | ||
146 | } | ||
147 | |||
148 | return 0; | ||
149 | } | ||
150 | EXPORT_SYMBOL(memcpy_fromiovec); | ||
151 | |||
152 | /* | ||
153 | * Copy iovec from kernel. Returns -EFAULT on error. | 103 | * Copy iovec from kernel. Returns -EFAULT on error. |
154 | */ | 104 | */ |
155 | 105 | ||