From: Andreas Dilger Date: Thu, 7 May 2020 00:08:14 +0000 (-0600) Subject: LU-13274 uapi: fix build on older kernels X-Git-Tag: 2.12.5-RC1~22 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fd34cb106a601cf1c71cfb46a9887a5d0ba2e46f;p=fs%2Flustre-release.git LU-13274 uapi: fix build on older kernels The recent changes to lustre_user.h broke building on older kernels, because it resulted in the user tools including both and , which results in conflicts for the declaration of the quotactl() function. Also, restore the compat declaration of __ALIGN_KERNEL(), though it only in lustre_user.h, since it is included in other headers anyway. Test-Parameters: trivial Fixes: 0417dce9fc75 ("LU-13274 uapi: make lustre UAPI headers C99 compliant") Signed-off-by: Andreas Dilger Change-Id: I9b31cabaf2732eb5872e88686e6af7d12e7d3564 Reviewed-on: https://review.whamcloud.com/38520 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/uapi/linux/lustre/lustre_user.h b/lustre/include/uapi/linux/lustre/lustre_user.h index 1f703f1..055542c 100644 --- a/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/lustre/include/uapi/linux/lustre/lustre_user.h @@ -42,22 +42,33 @@ * @{ */ -#include #include #include -#include -#include #include -#include -#include -#ifndef __KERNEL__ +#ifdef __KERNEL__ +# include +# include +# include /* snprintf() */ +# include +#else /* ! __KERNEL__ */ # include # include /* snprintf() */ +# include +# define NEED_QUOTA_DEFS +/* # include - this causes complaints about caddr_t */ # include # define FILEID_LUSTRE 0x97 /* for name_to_handle_at() (and llapi_fd2fid()) */ #endif /* !__KERNEL__ */ +/* Handle older distros */ +#ifndef __ALIGN_KERNEL +#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) +#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#endif + +#include + #if defined(__cplusplus) extern "C" { #endif