X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fcore%2Fiovec.c;h=04b249c40b5b24a12f0e24165621cc182b1ec1c4;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=587f933577684bf6db549b0ad6e44ccf04caefa5;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/net/core/iovec.c b/net/core/iovec.c index 587f93357..04b249c40 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c @@ -33,7 +33,7 @@ * Verify iovec. The caller must ensure that the iovec is big enough * to hold the message iovec. * - * Save time not doing verify_area. copy_*_user will make this work + * Save time not doing access_ok. copy_*_user will make this work * in any case. */ @@ -98,28 +98,6 @@ int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len) return 0; } -/* - * In kernel copy to iovec. Returns -EFAULT on error. - * - * Note: this modifies the original iovec. - */ - -void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len) -{ - while (len > 0) { - if (iov->iov_len) { - int copy = min_t(unsigned int, iov->iov_len, len); - memcpy(iov->iov_base, kdata, copy); - kdata += copy; - len -= copy; - iov->iov_len -= copy; - iov->iov_base += copy; - } - iov++; - } -} - - /* * Copy iovec to kernel. Returns -EFAULT on error. * @@ -157,7 +135,7 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset, } while (len > 0) { - u8 *base = iov->iov_base + offset; + u8 __user *base = iov->iov_base + offset; int copy = min_t(unsigned int, len, iov->iov_len - offset); offset = 0; @@ -180,9 +158,9 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset, * call to this function will be unaligned also. */ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov, - int offset, unsigned int len, int *csump) + int offset, unsigned int len, __wsum *csump) { - int csum = *csump; + __wsum csum = *csump; int partial_cnt = 0, err = 0; /* Skip over the finished iovecs */ @@ -192,7 +170,7 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov, } while (len > 0) { - u8 *base = iov->iov_base + offset; + u8 __user *base = iov->iov_base + offset; int copy = min_t(unsigned int, len, iov->iov_len - offset); offset = 0; @@ -259,4 +237,3 @@ EXPORT_SYMBOL(csum_partial_copy_fromiovecend); EXPORT_SYMBOL(memcpy_fromiovec); EXPORT_SYMBOL(memcpy_fromiovecend); EXPORT_SYMBOL(memcpy_toiovec); -EXPORT_SYMBOL(memcpy_tokerneliovec);