From b27a9487a119ed2886c3cadc31da5a8af5cecbbf Mon Sep 17 00:00:00 2001 From: niu Date: Fri, 21 Oct 2005 08:33:59 +0000 Subject: [PATCH] Disable compile userspace quota stuff for b1_4. This is short-term solution for the problem before b1_4_quota lands. -b 9542 -r adilger --- lustre/include/lustre/lustre_user.h | 14 ++++++++++++-- lustre/llite/dir.c | 2 ++ lustre/utils/lfs.c | 13 +++++++++++-- lustre/utils/liblustreapi.c | 1 - 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 6446634..8aa9939 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -15,7 +15,7 @@ #include #endif -#ifdef HAVE_LINUX_QUOTA_H +#ifdef HAVE_QUOTA_SUPPORT #include #endif @@ -160,6 +160,7 @@ struct mds_grp_downcall_data { __u32 mgd_groups[0]; }; + #ifndef __KERNEL__ #define NEED_QUOTA_DEFS #else @@ -169,6 +170,8 @@ struct mds_grp_downcall_data { # endif #endif +#ifdef HAVE_QUOTA_SUPPORT + #ifdef NEED_QUOTA_DEFS #ifndef QUOTABLOCK_BITS #define QUOTABLOCK_BITS 10 @@ -219,7 +222,7 @@ struct if_dqblk { #define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES) #endif -#endif /* !__KERNEL__ */ +#endif /* NEED_QUOTA_DEFS */ struct if_quotactl { int qc_cmd; @@ -232,6 +235,13 @@ struct if_quotactl { struct obd_uuid obd_uuid; }; +#else + +struct if_quotactl { +}; + +#endif /* HAVE_QUOTA_SUPPORT */ + #ifndef LPU64 /* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */ #if defined(__x86_64__) && defined(__KERNEL__) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 68196c3..cade821 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -724,6 +724,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, RETURN(0); } +#if HAVE_QUOTA_SUPPORT case OBD_IOC_QUOTACTL: { struct if_quotactl qctl; struct obd_quotactl oqctl; @@ -834,6 +835,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, RETURN(rc?:error); } +#endif /* HAVE_QUOTA_SUPPORT */ case OBD_IOC_GETNAME: { struct obd_device *obd = class_exp2obd(sbi->ll_osc_exp); if (!obd) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 8c88b1a..ae1332c 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -44,6 +44,10 @@ #include "parser.h" #include "obdctl.h" +unsigned int libcfs_subsystem_debug = 0; + +#ifdef HAVE_QUOTA_SUPPORT + /* FIXME: Q_SYNC ... commands defined in linux/quota.h seems broken, * so define new commands with the value in kernel */ #define LUSTRE_Q_QUOTAON 0x800002 /* turn quotas on */ @@ -59,7 +63,7 @@ # define GRPQUOTA 1 #endif -unsigned int libcfs_subsystem_debug = 0; +#endif /* HAVE_QUOTA_SUPPORT */ /* all functions */ static int lfs_setstripe(int argc, char **argv); @@ -68,12 +72,14 @@ static int lfs_getstripe(int argc, char **argv); static int lfs_osts(int argc, char **argv); static int lfs_check(int argc, char **argv); static int lfs_catinfo(int argc, char **argv); +#ifdef HAVE_QUOTA_SUPPORT static int lfs_quotachog(int argc, char **argv); static int lfs_quotacheck(int argc, char **argv); static int lfs_quotaon(int argc, char **argv); static int lfs_quotaoff(int argc, char **argv); static int lfs_setquota(int argc, char **argv); static int lfs_quota(int argc, char **argv); +#endif /* all avaialable commands */ command_t cmdlist[] = { @@ -104,6 +110,7 @@ command_t cmdlist[] = { "\tkeywords are one of followings: config, deletions.\n" "\tnode name must be provided when use keyword config."}, {"osts", lfs_osts, 0, "osts"}, +#ifdef HAVE_QUOTA_SUPPORT {"quotachog",lfs_quotachog, 0, "Change all files owner or group in specified filesystem.\n" "usage: quotachog [-i] \n" @@ -122,6 +129,7 @@ command_t cmdlist[] = { {"quota", lfs_quota, 0, "Display disk usage and limits.\n" "usage: quota -t [ -u |-g ] \n" " quota [ -o obd_uuid ] [ -u | -g ] [name] "}, +#endif {"help", Parser_help, 0, "help"}, {"exit", Parser_quit, 0, "quit"}, {"quit", Parser_quit, 0, "quit"}, @@ -429,7 +437,7 @@ static int lfs_catinfo(int argc, char **argv) return rc; } - +#ifdef HAVE_QUOTA_SUPPORT static int lfs_quotachog(int argc, char **argv) { @@ -953,6 +961,7 @@ static int lfs_quota(int argc, char **argv) print_quota(mnt, name, &qctl); return 0; } +#endif /* HAVE_QUOTA_SUPPORT */ int main(int argc, char **argv) { diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 9825387..67fc615 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -866,4 +866,3 @@ out: cleanup_find(¶m); return ret; } - -- 1.8.3.1