Skip to content

Commit

Permalink
uio: mark uio.h functions __KERNEL__ only
Browse files Browse the repository at this point in the history
To avoid userspace build failures such as:

.../linux/uio.h:37: error: expected `=', `,', `;', `asm' or `__attribute__' before `iov_length'
.../linux/uio.h:47: error: expected declaration specifiers or `...' before `size_t'

move uio functions inside a __KERNEL__ block.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Jul 30, 2009
1 parent 8da14b5 commit 812ed03
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions include/linux/uio.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,20 @@ struct iovec
__kernel_size_t iov_len; /* Must be size_t (1003.1g) */
};

#ifdef __KERNEL__

struct kvec {
void *iov_base; /* and that should *never* hold a userland pointer */
size_t iov_len;
};

#endif

/*
* UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
*/

#define UIO_FASTIOV 8
#define UIO_MAXIOV 1024

#ifdef __KERNEL__

struct kvec {
void *iov_base; /* and that should *never* hold a userland pointer */
size_t iov_len;
};

/*
* Total number of bytes covered by an iovec.
*
Expand All @@ -53,5 +51,6 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
}

unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
#endif

#endif

0 comments on commit 812ed03

Please sign in to comment.