From 2d83bdebac62839f054434164d3329b8d62fa065 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Tue, 16 Mar 2010 20:02:44 +0300 Subject: [PATCH] b=22194 Add quiet -q option to lfs quota o=Joseph Herring (LLNL) i=Johann Lombardi i=ZhiYong Tian --- lustre/doc/lfs.1 | 6 +++--- lustre/utils/lfs.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lustre/doc/lfs.1 b/lustre/doc/lfs.1 index b345af6..277bc7c 100644 --- a/lustre/doc/lfs.1 +++ b/lustre/doc/lfs.1 @@ -32,7 +32,7 @@ lfs \- Lustre utility to create a file with specific striping pattern, find the .br .B lfs poollist [.] | .br -.B lfs quota [-v] [-o obd_uuid] [<-u|-g> ||] +.B lfs quota [-q] [-v] [-o obd_uuid] [<-u|-g> ||] .br .B lfs quota -t <-u|-g> .br @@ -148,8 +148,8 @@ To set filesystem quotas for users or groups. Limits can be specified with -b, - .B setquota -t <-u|-g> [--block-grace ] [--inode-grace ] To set filesystem quota grace times for users or groups. Grace time is specified in "XXwXXdXXhXXmXXs" format or as an integer seconds value, see EXAMPLES .TP -.B quota [-v] [-o obd_uuid] [ -u|-g ] -To display disk usage and limits, either for the full filesystem, or for objects on a specific obd. A user or group name or an ID can be specified. If both user and group are omitted quotas for current uid/gid are shown. -v provides more verbose (with per-obd statistics) output. +.B quota [-q] [-v] [-o obd_uuid] [ -u|-g ] +To display disk usage and limits, either for the full filesystem, or for objects on a specific obd. A user or group name or an ID can be specified. If both user and group are omitted quotas for current uid/gid are shown. -v provides more verbose (with per-obd statistics) output. -q disables printing of additional descriptions (including column titles). .TP .B quota -t <-u|-g> To display block and inode grace times for user (-u) or group (-g) quotas diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 409fb41..2339061 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -187,9 +187,9 @@ command_t cmdlist[] = { " -i can be used instead of --inode-softlimit/--inode-grace\n" " -I can be used instead of --inode-hardlimit"}, {"quota", lfs_quota, 0, "Display disk usage and limits.\n" - "usage: quota [-v] [ -o obd_uuid ] [<-u|-g> |||]\n" - " \n" - " quota [ -o obd_uuid ] -t <-u|-g> "}, + "usage: quota [<-u|-g> |||]\n" + " [-q] [-v] [-o ] \n" + " quota [-o ] -t <-u|-g> "}, {"quotainv", lfs_quotainv, 0, "Invalidate quota data.\n" "usage: quotainv [-u|-g] "}, #endif @@ -2186,13 +2186,13 @@ static int lfs_quota(int argc, char **argv) .qc_type = UGQUOTA }; char *obd_type = (char *)qctl.obd_type; char *obd_uuid = (char *)qctl.obd_uuid.uuid; - int rc, rc1 = 0, rc2 = 0, rc3 = 0, verbose = 0, inacc; + int rc, rc1 = 0, rc2 = 0, rc3 = 0, verbose = 0, inacc, quiet = 0; int pass = 0; char *endptr; int version; optind = 0; - while ((c = getopt(argc, argv, "ugto:v")) != -1) { + while ((c = getopt(argc, argv, "ugto:qv")) != -1) { switch (c) { case 'u': if (qctl.qc_type != UGQUOTA) { @@ -2217,6 +2217,9 @@ static int lfs_quota(int argc, char **argv) case 'v': verbose = 1; break; + case 'q': + quiet = 1; + break; default: fprintf(stderr, "error: %s: option '-%c' " "unrecognized\n", argv[0], c); @@ -2294,7 +2297,7 @@ ug_output: } } - if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA) + if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA && !quiet) print_quota_title(name, &qctl); if (rc1 && *obd_type) -- 1.8.3.1