\fB[[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n pattern]
\fB[--print|-p] \fB[--print0|-P] [--obd|-O <uuid[s]>]
\fB[[!] --size|-S [-+]N[kMGTPE]] [--type |-t {bcdflpsD}]
- \fB[[!] --gid|-g N] [[!] --group|-G <name>]
- \fB[[!] --uid|-u N] [[!] --user|-U <name>]
+ \fB[[!] --gid|-g|--group|-G <gname>|<gid>]
+ \fB[[!] --uid|-u|--user|-U <uname>|<uid>]
\fB<dirname|filename>\fR
.br
.B lfs osts
.br
.B lfs poollist <filesystem>[.<pool>] | <pathname>
.br
-.B lfs quota [-v] [-o obd_uuid] [-u <username>|-g <groupname>] <filesystem>
+.B lfs quota [-v] [-o obd_uuid] [<-u|-g> <uname>|<uid>|<gname><gid>] <filesystem>
.br
.B lfs quota -t <-u|-g> <filesystem>
.br
.br
.B lfs quotainv [-ug] [-f] <filesystem>
.br
-.B lfs setquota <-u|--user|-g|--group> <username|groupname>
+.B lfs setquota <-u|--user|-g|--group> <uname|uid|gname|gid>
\fB[--block-softlimit <block-softlimit>]
\fB[--block-hardlimit <block-hardlimit>]
\fB[--inode-softlimit <inode-softlimit>]
\fB[--inode-hardlimit <inode-hardlimit>]
\fB<filesystem>\fR
.br
-.B lfs setquota <-u|--user|-g|--group> <username|groupname>
+.B lfs setquota <-u|--user|-g|--group> <uname|uid|gname|gid>
\fB[-b <block-softlimit>] [-B <block-hardlimit>]
\fB[-i <inode-softlimit>] [-I <inode-hardlimit>]
\fB<filesystem>\fR
\fB[--inode-grace <inode-grace>]
\fB<filesystem>\fR
.br
-.B lfs setquota -t [-u|-g]
+.B lfs setquota -t <-u|-g>
\fB[-b <block-grace>] [-i <inode-grace>]
\fB<filesystem>\fR
.br
.B quotainv [-ug] [-f] <filesystem>
Clear quota files (administrative quota files if used without -f, operational quota files otherwise), all of their quota entries, for (-u) users or (-g) groups; after quotainv one must use quotacheck before using quotas. DO NOT USE THIS COMMAND UNLESS YOU REALLY KNOW WHAT IT DOES. IT IS MAINLY FOR INTERNAL PURPOSES.
.TP
-.B setquota [-u|-g] <name> [--block-softlimit <block-softlimit>] [--block-hardlimit <block-hardlimit>] [--inode-softlimit <inode-softlimit>] [--inode-hardlimit <inode-hardlimit>] <filesystem>
+.B setquota <-u|-g> <uname>|<uid>|<gname>|<gid> [--block-softlimit <block-softlimit>] [--block-hardlimit <block-hardlimit>] [--inode-softlimit <inode-softlimit>] [--inode-hardlimit <inode-hardlimit>] <filesystem>
To set filesystem quotas for users or groups. Limits can be specified with -b, -k, -m, -g, -t, -p suffixes which specify units of 1, 2^10, 2^20, 2^30, 2^40 and 2^50 accordingly. Block limits unit is kilobyte (1024) by default and block limits are always kilobyte-grained (even if specified in bytes), see EXAMPLES
.TP
-.B setquota -t [-u|-g] [--block-grace <block-grace>] [--inode-grace <inode-grace>] <filesystem>
+.B setquota -t <-u|-g> [--block-grace <block-grace>] [--inode-grace <inode-grace>] <filesystem>
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] <username|groupname> <filesystem>
-To display disk usage and limits, either for the full filesystem, or for objects on a specific obd. A user or group name 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 [-v] [-o obd_uuid] [ -u|-g <uname|uid|gname|gid> ] <filesystem>
+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.
.TP
-.B quota -t [-u|-g] <filesystem>
+.B quota -t <-u|-g> <filesystem>
To display block and inode grace times for user (-u) or group (-g) quotas
.TP
.B help
" [[!] --atime|-A [+-]N] [[!] --mtime|-M [+-]N] [[!] --ctime|-C [+-]N]\n"
" [--maxdepth|-D N] [[!] --name|-n <pattern>] [--print0|-P]\n"
" [--print|-p] [--obd|-O <uuid[s]>] [[!] --size|-s [+-]N[bkMGTP]]\n"
- " [[!] --type|-t <filetype>] [[!] --gid|-g N] [[!] --group|-G <name>]\n"
- " [[!] --uid|-u N] [[!] --user|-U <name>]\n"
+ " [[!] --type|-t <filetype>] [[!] --gid|-g|--group|-G <gid>|<gname>]\n"
+ " [[!] --uid|-u|--user|-U <uid>|<uname>]\n"
" [[!] --pool <pool>]\n"
"\t !: used before an option indicates 'NOT' the requested attribute\n"
"\t -: used before an value indicates 'AT MOST' the requested value\n"
{"quotaoff", lfs_quotaoff, 0, "Turn filesystem quotas off.\n"
"usage: quotaoff [ -ug ] <filesystem>"},
{"setquota", lfs_setquota, 0, "Set filesystem quotas.\n"
- "usage: setquota [ -u | -g ] <name> <block-softlimit> <block-hardlimit> <inode-softlimit> <inode-hardlimit> <filesystem>\n"
- " setquota -t [ -u | -g ] <block-grace> <inode-grace> <filesystem>\n"
- " setquota [ -u | --user | -g | --group ] <name>\n"
+ "usage: setquota <-u|-g> <uname>|<uid>|<gname>|<gid>\n"
+ " <block-softlimit> <block-hardlimit>\n"
+ " <inode-softlimit> <inode-hardlimit>\n"
+ " <filesystem>\n"
+ " setquota <-u|--user|-g|--group> <uname>|<uid>|<gname>|<gid>\n"
" [--block-softlimit <block-softlimit>]\n"
" [--block-hardlimit <block-hardlimit>]\n"
" [--inode-softlimit <inode-softlimit>]\n"
" [--inode-hardlimit <inode-hardlimit>] <filesystem>\n"
- " setquota [-t] [ -u | --user | -g | --group ]\n"
+ " setquota -t <-u|-g> <block-grace> <inode-grace> <filesystem>\n"
+ " setquota -t <-u|--user|-g|--group>\n"
" [--block-grace <block-grace>]\n"
" [--inode-grace <inode-grace>] <filesystem>\n"
" -b can be used instead of --block-softlimit/--block-grace\n"
" -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 [ -o obd_uuid ] [{-u|-g <name>}|-t] <filesystem>"},
+ "usage: quota [-v] [ -o obd_uuid ] [<-u|-g> <uname>|<uid>|<gname>|<gid>]\n"
+ " <filesystem>\n"
+ " quota [ -o obd_uuid ] -t <-u|-g> <filesystem>"},
{"quotainv", lfs_quotainv, 0, "Invalidate quota data.\n"
"usage: quotainv [-u|-g] <filesystem>"},
#endif
param.maxdepth = strtol(optarg, 0, 0);
break;
case 'g':
- new_fashion = 1;
- param.gid = strtol(optarg, &endptr, 10);
- if (optarg == endptr) {
- fprintf(stderr, "Bad gid: %s\n", optarg);
- return CMD_HELP;
- }
- param.exclude_gid = !!neg_opt;
- param.check_gid = 1;
- break;
case 'G':
new_fashion = 1;
- param.gid = strtol(optarg, &endptr, 10);
- if (optarg == endptr) {
- ret = name2id(¶m.gid, optarg, GROUP);
- if (ret != 0) {
+ ret = name2id(¶m.gid, optarg, GROUP);
+ if (ret) {
+ param.gid = strtoul(optarg, &endptr, 10);
+ if (*endptr != '\0') {
fprintf(stderr, "Group/GID: %s cannot "
"be found.\n", optarg);
return -1;
}
- }
+ }
param.exclude_gid = !!neg_opt;
param.check_gid = 1;
break;
case 'u':
- new_fashion = 1;
- param.uid = strtol(optarg, &endptr, 10);
- if (optarg == endptr) {
- fprintf(stderr, "Bad uid: %s\n", optarg);
- return CMD_HELP;
- }
- param.exclude_uid = !!neg_opt;
- param.check_uid = 1;
- break;
case 'U':
new_fashion = 1;
- param.uid = strtol(optarg, &endptr, 10);
- if (optarg == endptr) {
- ret = name2id(¶m.uid, optarg, USER);
- if (ret != 0) {
+ ret = name2id(¶m.uid, optarg, USER);
+ if (ret) {
+ param.uid = strtoul(optarg, &endptr, 10);
+ if (*endptr != '\0') {
fprintf(stderr, "User/UID: %s cannot "
"be found.\n", optarg);
return -1;
{0, 0, 0, 0}
};
unsigned limit_mask = 0;
+ char *endptr;
if (has_times_option(argc, argv))
return lfs_setquota_times(argc, argv);
rc = name2id(&qctl.qc_id, optarg,
(qctl.qc_type == USRQUOTA) ? USER : GROUP);
if (rc) {
- fprintf(stderr, "error: unknown id %s\n",
- optarg);
- return CMD_HELP;
+ qctl.qc_id = strtoul(optarg, &endptr, 10);
+ if (*endptr != '\0') {
+ fprintf(stderr, "error: can't find id "
+ "for name %s\n", optarg);
+ return CMD_HELP;
+ }
}
break;
case 'b':
char *obd_uuid = (char *)qctl.obd_uuid.uuid;
int rc, rc1 = 0, rc2 = 0, rc3 = 0, verbose = 0;
int pass = 0;
+ char *endptr;
optind = 0;
while ((c = getopt(argc, argv, "ugto:v")) != -1) {
rc = name2id(&qctl.qc_id, name,
(qctl.qc_type == USRQUOTA) ? USER : GROUP);
if (rc) {
- fprintf(stderr,"error: can't find id for name %s: %s\n",
- name, strerror(errno));
- return CMD_HELP;
+ qctl.qc_id = strtoul(name, &endptr, 10);
+ if (*endptr != '\0') {
+ fprintf(stderr, "error: can't find id for name "
+ "%s\n", name);
+ return CMD_HELP;
+ }
}
} else if (optind + 1 != argc || qctl.qc_type == UGQUOTA) {
fprintf(stderr, "error: missing quota info argument(s)\n");