#include <lustre/types.h>
#endif
-#ifdef HAVE_LINUX_QUOTA_H
+#ifdef HAVE_QUOTA_SUPPORT
#include <linux/quota.h>
#endif
__u32 mgd_groups[0];
};
+
#ifndef __KERNEL__
#define NEED_QUOTA_DEFS
#else
# endif
#endif
+#ifdef HAVE_QUOTA_SUPPORT
+
#ifdef NEED_QUOTA_DEFS
#ifndef QUOTABLOCK_BITS
#define QUOTABLOCK_BITS 10
#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
#endif
-#endif /* !__KERNEL__ */
+#endif /* NEED_QUOTA_DEFS */
struct if_quotactl {
int qc_cmd;
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__)
#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 */
# define GRPQUOTA 1
#endif
-unsigned int libcfs_subsystem_debug = 0;
+#endif /* HAVE_QUOTA_SUPPORT */
/* all functions */
static int lfs_setstripe(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[] = {
"\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] <filesystem>\n"
{"quota", lfs_quota, 0, "Display disk usage and limits.\n"
"usage: quota -t [ -u |-g ] <filesystem>\n"
" quota [ -o obd_uuid ] [ -u | -g ] [name] <filesystem>"},
+#endif
{"help", Parser_help, 0, "help"},
{"exit", Parser_quit, 0, "quit"},
{"quit", Parser_quit, 0, "quit"},
return rc;
}
-
+#ifdef HAVE_QUOTA_SUPPORT
static int lfs_quotachog(int argc, char **argv)
{
print_quota(mnt, name, &qctl);
return 0;
}
+#endif /* HAVE_QUOTA_SUPPORT */
int main(int argc, char **argv)
{