lkml.org 
[lkml]   [2008]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] linux/uio.h: cleanup for userspace
On Mon, Dec 29, 2008 at 07:59:59AM -0500, Mike Frysinger wrote:
> Hide iov_shorten() behind __KERNEL__ since it's a prototype only. Use the
> __inline__ form for iov_length() since it's usable by userspace.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> v3
> - keep all __KERNEL__ stuff in one place
> v2
> - drop inline conversion stuff
>
> include/linux/uio.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/uio.h b/include/linux/uio.h
> index b7fe138..3debd89 100644
> --- a/include/linux/uio.h
> +++ b/include/linux/uio.h
> @@ -26,6 +26,8 @@ struct kvec {
> size_t iov_len;
> };
>
> +unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
> +
> #endif
>
> /*
> @@ -52,6 +54,4 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
> return ret;
> }
>
> -unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
> -
> #endif

Umm, iov_length is another kernel-only thing and should not be left
user-visible. And struct kvec is in another __KERNEL__ block.

Just move UIO_FASTIOV and UIO_MAXIOV up and have a single __KERNEL__
block for the rest.



\
 
 \ /
  Last update: 2008-12-29 14:07    [W:0.154 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site