Whamcloud - gitweb
LU-4017 quota: add project quota support to system header 46/23946/10
authorLi Xi <lixi@ddn.com>
Thu, 3 Apr 2014 07:47:21 +0000 (15:47 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 13 Apr 2017 06:20:21 +0000 (06:20 +0000)
System header contains the quota macros. Project quota support
should be added to it so that user space utils can be compiled
successfully

This patch redefines some macros in the system header file,
which avoids to change the sytem header file directly.

Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I1ed8014b1050684891df43d4c3db3c2e90b7814c
Reviewed-on: https://review.whamcloud.com/23946
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre/lustre_user.h
lustre/utils/lfs.c

index 5a2fc74..f1e7fc4 100644 (file)
 #endif /* __KERNEL__ */
 #include <lustre/ll_fiemap.h>
 
 #endif /* __KERNEL__ */
 #include <lustre/ll_fiemap.h>
 
+/*
+ * This is a temporary solution of adding quota type.
+ * Should be removed as soon as system header is updated.
+ */
+#undef LL_MAXQUOTAS
+#define LL_MAXQUOTAS 2
+#undef INITQFNAMES
+#define INITQFNAMES { \
+    "user",    /* USRQUOTA */ \
+    "group",   /* GRPQUOTA */ \
+    "project", /* PRJQUOTA */ \
+    "undefined", \
+};
+#define PRJQUOTA 2
+
 #if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) || \
     defined(__craynv) || defined(__mips64__) || defined(__powerpc64__) || \
     defined(__aarch64__)
 #if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) || \
     defined(__craynv) || defined(__mips64__) || defined(__powerpc64__) || \
     defined(__aarch64__)
index 53f9437..2688808 100644 (file)
@@ -60,9 +60,6 @@
 #include <dirent.h>
 #include <time.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <time.h>
 #include <ctype.h>
-#ifdef HAVE_SYS_QUOTA_H
-# include <sys/quota.h>
-#endif
 
 #include <libcfs/util/string.h>
 #include <libcfs/util/ioctl.h>
 
 #include <libcfs/util/string.h>
 #include <libcfs/util/ioctl.h>