From 3cf95c0bd388489c75382083a5b9a9b99d769415 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 14 Dec 2018 15:53:25 -0700 Subject: [PATCH] LU-11783 utils: fix warnings when lustre_user.h included Checking for lustre/lustre_user.h in a configure script generates a warning because of the included checking lustre/lustre_user.h usability... no checking lustre/lustre_user.h presence... yes WARNING: present but cannot be compiled WARNING: check for missing prerequisite headers? WARNING: see the Autoconf documentation WARNING: section "Present But Cannot Be Compiled" WARNING: proceeding with the preprocessor's result WARNING: in the future, the compiler will take precedence Looking into config.log it shows: In file included from /usr/include/lustre/lustre_user.h:59, from conftest.c:91: /usr/include/sys/quota.h:221: error: expected declaration specifiers or '...' before 'caddr_t' Since we don't really need much from the header, add conditional #defines for the few needed fields. The FASYNC constant is not declared everywhere in userspace, provide a compat declaration if unavailable. Lustre-change: https://review.whamcloud.com/33876 Lustre-commit: db0592145574c5ad22a7b7372b06ba2da7d85a60 Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I9cd2b0fcbaf16fe8a5a4a7a0309aada3a72cab07 Reviewed-by: Wang Shilong Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/34064 Tested-by: Jenkins Tested-by: Maloo --- lustre/include/lustre/lustre_user.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index c014ed7..208beac 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -50,12 +50,12 @@ # include /* snprintf() */ # include #else /* !__KERNEL__ */ -# define NEED_QUOTA_DEFS # include # include # include /* snprintf() */ # include -# include +# define NEED_QUOTA_DEFS +/* # include - this causes complaints about caddr_t */ # include #endif /* __KERNEL__ */ #include @@ -73,7 +73,15 @@ "project", /* PRJQUOTA */ \ "undefined", \ }; +#ifndef USRQUOTA +#define USRQUOTA 0 +#endif +#ifndef GRPQUOTA +#define GRPQUOTA 1 +#endif +#ifndef PRJQUOTA #define PRJQUOTA 2 +#endif #if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) || \ defined(__craynv) || defined(__mips64__) || defined(__powerpc64__) || \ @@ -410,6 +418,9 @@ enum ll_lease_type { /* To be compatible with old statically linked binary we keep the check for * the older 0100000000 flag. This is already removed upstream. LU-812. */ #define O_LOV_DELAY_CREATE_1_8 0100000000 /* FMODE_NONOTIFY masked in 2.6.36 */ +#ifndef FASYNC +#define FASYNC 00020000 /* fcntl, for BSD compatibility */ +#endif #define O_LOV_DELAY_CREATE_MASK (O_NOCTTY | FASYNC) #define O_LOV_DELAY_CREATE (O_LOV_DELAY_CREATE_1_8 | \ O_LOV_DELAY_CREATE_MASK) -- 1.8.3.1