From fd34cb106a601cf1c71cfb46a9887a5d0ba2e46f Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 6 May 2020 18:08:14 -0600 Subject: [PATCH] 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 --- lustre/include/uapi/linux/lustre/lustre_user.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) 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 -- 1.8.3.1