From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Slaby Subject: [PATCH 1/1] UIO: unbreak uio.h userspace compilation Date: Tue, 28 Jul 2009 15:14:37 +0200 Message-ID: <1248786877-10571-1-git-send-email-jirislaby@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, Andrew Morton , linux-kernel@vger.kernel.org, Jiri Slaby To: Alexander Viro Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org To avoid userspace build failures such as: =2E../linux/uio.h:37: error: expected =E2=80=98=3D=E2=80=99, =E2=80=98,= =E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99 or =E2=80=98__att= ribute__=E2=80=99 before =E2=80=98iov_length=E2=80=99 =2E../linux/uio.h:47: error: expected declaration specifiers or =E2=80=98= =2E..=E2=80=99 before =E2=80=98size_t=E2=80=99 move one uio declaration inside a __KERNEL__ block and use __kernel_siz= e_t instead of size_t for iov_length (it's inlined and used in userspace al= ready). Signed-off-by: Jiri Slaby --- include/linux/uio.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/uio.h b/include/linux/uio.h index b7fe138..9b2623c 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -42,16 +42,18 @@ struct kvec { * segment lengths have been validated. Because the individual length= s can * overflow a size_t when added together. */ -static inline size_t iov_length(const struct iovec *iov, unsigned long= nr_segs) +static inline __kernel_size_t iov_length(const struct iovec *iov, unsi= gned long nr_segs) { unsigned long seg; - size_t ret =3D 0; + __kernel_size_t ret =3D 0; =20 for (seg =3D 0; seg < nr_segs; seg++) ret +=3D iov[seg].iov_len; return ret; } =20 +#ifdef __KERNEL__ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, si= ze_t to); +#endif =20 #endif --=20 1.6.3.3