lfs-quota \- display quota limits and status for users, groups, or projects.
.SH SYNOPSIS
.SY "lfs quota"
-.RB [ -q ]
-.RB [ -v ]
-.RB [ -h ]
-.RB [ -o
+.RB [ -q | --quiet ]
+.RB [ -v | --verbose ]
+.RB [ -h | --human-readable ]
+.RB [ -o | --ost
.IR OBD_UUID | OST_IDX
-.RB "| " -m
+.RB "| " -m | --mdt
.IR MDT_IDX ]
-.RB [ -u
+.RB [ -u | --user
.IR USER " |"
-.BI "-g " GROUP
-.RB "| " -p
+.BI -g | --group GROUP
+.BR "| " -p | --projid
.IR PROJID ]
.RB [ --pool
.IR OST_POOL_NAME ]
.EX
-.RB [ --filesystem | --mount-point ]
.RB [ --blocks | --busage | --space ]
.RB [ --block-softlimit | --bsoftlimit ]
.RB [ --block-hardlimit | --bhardlimit ]
.RB [ --block-grace | --bgrace | --btime ]
+.RB [ --filesystem | --mount-point ]
.RB [ --inodes | --iusage ]
.RB [ --inode-softlimit | --isoftlimit ]
.RB [ --inode-hardlimit | --ihardlimit ]
.RB [ --inode-grace | --igrace | --itime ]
.EE
.RI [ MOUNT_POINT " ...]"
-.SY
-.BR "lfs quota " [ -hq "] {" -U | -G | -P }
+.SY "lfs quota"
+.BR [ -hq ]
+.RB { -U | --default-usr | -G | --default-grp | -P | --default-prj }
.RI [ MOUNT_POINT " ...]"
-.SY
-.BR "lfs quota " -t " {" -u | -g | -p }
+.SY "lfs quota"
+.B -t | --times
+.RB { -u | -g | -p }
.RI [ MOUNT_POINT " ...]"
-.SY
-.BR "lfs quota " -a " {" -u | -g | -p }
+.SY "lfs quota"
+.B -a | --all
+.RB { -u | -g | -p }
.RI [ MOUNT_POINT " ...]"
.YS
.SH DESCRIPTION
respectively. Time values will use the "XXwXXdXXhXXmXXs" format, which
specifies weeks, days, hours, minutes, seconds.
.TP
-.BR --blocks | --busage | --space
+.BR --blocks | --busage | --space | --kbytes
Print only the
-.B kbytes
-column representing the block usage space.
+.BR kbytes / usage
+column representing the block space usage.
If other column options are specified, all specified columns will be printed.
.TP
.BR --block-softlimit | --bsoftlimit
column representing either the mount point or device name.
If other column options are specified, all specified columns will be printed.
.TP
-.BR --inodes | --iusage
+.BR -g | --group " {" \fIGROUP | \fIGID }
+Display quota information for group name \fIGROUP\fR or numeric \fIGID\fR.
+.TP
+.BR --inodes | --iusage | --files
Print only the
.B files
-column representing the inodes.
+column representing the number of inodes used.
If other column options are specified, all specified columns will be printed.
.TP
.BR --inode-softlimit | --isoftlimit
# bhardlimit|bsoftlimit|bgrace|ihardlimit|isoftlimit|igrace \
# <pool_name>
getquota() {
- local spec
+ local type=$1
+ local id=$2
local uuid
+ local spec=$4
+ local pool=$5
local pool_arg
sync_all_data > /dev/null 2>&1 || true
- [ "$#" != 4 -a "$#" != 5 ] &&
+ [[ "$#" != 4 && "$#" != 5 ]] &&
error "getquota: wrong number of arguments: $#"
- [ "$1" != "-u" -a "$1" != "-g" -a "$1" != "-p" ] &&
+ [[ "$type" != "-u" && "$type" != "-g" && "$type" != "-p" ]] &&
error "getquota: wrong u/g/p specifier $1 passed"
- uuid="$3"
-
- case "$4" in
- curspace) spec=1;;
- bsoftlimit) spec=2;;
- bhardlimit) spec=3;;
- bgrace) spec=4;;
- curinodes) spec=5;;
- isoftlimit) spec=6;;
- ihardlimit) spec=7;;
- igrace) spec=8;;
- *) error "unknown quota parameter $4";;
- esac
-
- [ ! -z "$5" ] && pool_arg="--pool $5 "
- [ "$uuid" = "global" ] && uuid=$DIR
+ [[ "$spec" =~ "curspace" ]] && spec="space"
+ [[ "$spec" =~ "curinode" ]] && spec="inodes"
+ [[ ! -z "$pool" ]] && pool_arg="--pool $pool "
+ [[ "$3" =~ "OST" ]] && uuid="--ost $(echo "$3" | tail -c 4) "
+ [[ "$3" =~ "MDT" ]] && uuid="--mdt $(echo "$3" | tail -c 4) "
- $LFS quota -v "$1" "$2" $pool_arg $DIR 1>&2
- $LFS quota -v "$1" "$2" $pool_arg $DIR |
- awk 'BEGIN { num='$spec' } { if ($1 ~ "'$uuid'") \
- { if (NF == 1) { getline } else { num++ } ; print $num;} }' \
- | tr -d "*"
+ echo -n "$type $id $uuid $spec:" 1>&2
+ $LFS quota -q $uuid --$spec "$type" "$id" $pool_arg$DIR | tr -d "*" 1>&2
+ $LFS quota -q $uuid --$spec "$type" "$id" $pool_arg$DIR | tr -d "*"
}
# set mdt quota type
.name = "busage", .has_arg = no_argument },
{ .val = LFS_QUOTA_SPACE_OPT,
.name = "space", .has_arg = no_argument },
- { .val = 'b',
- .name = "block-softlimit", .has_arg = no_argument },
- { .val = 'b',
- .name = "bsoftlimit", .has_arg = no_argument },
+ { .val = LFS_QUOTA_SPACE_OPT,
+ .name = "kbytes", .has_arg = no_argument },
+ { .val = 'b', .name = "block-softlimit", .has_arg = no_argument },
+ { .val = 'b', .name = "bsoftlimit", .has_arg = no_argument },
{ .val = 'b', .name = "bquota", .has_arg = no_argument },
- { .val = 'B',
- .name = "block-hardlimit", .has_arg = no_argument },
+ { .val = 'B', .name = "block-hardlimit", .has_arg = no_argument },
{ .val = 'B', .name = "bhardlimit", .has_arg = no_argument },
{ .val = 'B', .name = "blimit", .has_arg = no_argument },
{ .val = LFS_QUOTA_BGRACE_OPT,
.name = "inodes", .has_arg = no_argument },
{ .val = LFS_QUOTA_INODES_OPT,
.name = "iusage", .has_arg = no_argument },
+ { .val = LFS_QUOTA_INODES_OPT,
+ .name = "files", .has_arg = no_argument },
{ .val = LFS_QUOTA_ISOFTLIMIT_OPT,
.name = "inode-softlimit", .has_arg = no_argument },
{ .val = LFS_QUOTA_ISOFTLIMIT_OPT,