From: Andreas Dilger Date: Tue, 9 Mar 2021 05:59:42 +0000 (-0700) Subject: LU-14535 quota: improve quota output format X-Git-Tag: 2.15.51~115 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=cd1847e73e5990ef797280846dc27fc0b0a876e9;p=fs%2Flustre-release.git LU-14535 quota: improve quota output format Make the output of the quota proc files more readable by removing needless whitespace that causes it to wrap over a single line. Signed-off-by: Andreas Dilger Change-Id: I80fbd42dea865dff1d106724dbf69946d23ebbe5 Reviewed-on: https://review.whamcloud.com/43099 Reviewed-by: Sergey Cheremencev Tested-by: jenkins Reviewed-by: Hongchao Zhang Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 23cc810..651ed88 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -249,12 +249,12 @@ static int lprocfs_quota_seq_show(struct seq_file *p, void *v) seq_printf(p, "- %-8s %llu\n", "id:", *((__u64 *)key)); if (fid_is_acct(fid)) - seq_printf(p, " %-8s { inodes: %20llu, kbytes: %20llu }\n", "usage:", - ((struct lquota_acct_rec *)rec)->ispace, + seq_printf(p, " %-8s { inodes: %12llu, kbytes: %12llu }\n", + "usage:", ((struct lquota_acct_rec *)rec)->ispace, toqb(((struct lquota_acct_rec *)rec)->bspace)); else if (fid_seq(fid) == FID_SEQ_QUOTA_GLB || fid_seq(fid) == FID_SEQ_LOCAL_NAME) - seq_printf(p, " %-8s { hard: %20llu, soft: %20llu, granted: %20llu, time: %20llu }\n", + seq_printf(p, " %-8s { hard: %12llu, soft: %12llu, granted: %12llu, time: %15llu }\n", "limits:", ((struct lquota_glb_rec *)rec)->qbr_hardlimit, ((struct lquota_glb_rec *)rec)->qbr_softlimit, diff --git a/lustre/quota/qmt_pool.c b/lustre/quota/qmt_pool.c index c4398a5..4b6004a 100644 --- a/lustre/quota/qmt_pool.c +++ b/lustre/quota/qmt_pool.c @@ -85,8 +85,8 @@ static int qpi_state_seq_show(struct seq_file *m, void *data) seq_printf(m, "pool:\n" " id: %u\n" " type: %s\n" - " ref: %d\n" - " least qunit: %lu\n", + " refcount: %d\n" + " least_qunit: %lu\n", 0, RES_NAME(pool->qpi_rtype), atomic_read(&pool->qpi_ref), @@ -94,8 +94,8 @@ static int qpi_state_seq_show(struct seq_file *m, void *data) for (type = 0; type < LL_MAXQUOTAS; type++) seq_printf(m, " %s:\n" - " #slv: %d\n" - " #lqe: %d\n", + " quota_servers: %d\n" + " quota_entries: %d\n", qtype_name(type), qpi_slv_nr(pool, type), atomic_read(&pool->qpi_site[type]->lqs_hash->hs_count)); diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 4a534be..cfcc258 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -128,17 +128,20 @@ resetquota() { quota_scan() { local local_ugp=$1 local local_id=$2 + local count if [ "$local_ugp" == "a" -o "$local_ugp" == "u" ]; then $LFS quota -v -u $local_id $DIR - log "Files for user ($local_id):" + count=$($LFS find --user $local_id $DIR | wc -l) + log "Files for user ($local_id), count=$count:" ($LFS find --user $local_id $DIR | head -n 4 | xargs stat 2>/dev/null) fi if [ "$local_ugp" == "a" -o "$local_ugp" == "g" ]; then $LFS quota -v -g $local_id $DIR - log "Files for group ($local_id):" + count=$($LFS find --group $local_id $DIR | wc -l) + log "Files for group ($local_id), count=$count:" ($LFS find --group $local_id $DIR | head -n 4 | xargs stat 2>/dev/null) fi @@ -146,7 +149,8 @@ quota_scan() { is_project_quota_supported || return 0 if [ "$local_ugp" == "a" -o "$local_ugp" == "p" ]; then $LFS quota -v -p $TSTPRJID $DIR - log "Files for project ($TSTPRJID):" + count=$($LFS find --projid $TSTPRJID $DIR | wc -l) + log "Files for project ($TSTPRJID), count=$count:" ($LFS find --projid $TSTPRJID $DIR | head -n 4 | xargs stat 2>/dev/null) fi @@ -1183,11 +1187,13 @@ test_2() { local testfile="$DIR/$tdir/$tfile-0" local least_qunit=$(do_facet mds1 $LCTL get_param -n \ qmt.$FSNAME-QMT0000.md-0x0.info | - awk '/least qunit/{ print $3 }') + sed -e 's/least qunit/least_qunit/' | + awk '/least_qunit/{ print $2 }') local limit [ "$SLOW" = "no" ] && limit=$((least_qunit * 2)) || limit=$((least_qunit * 1024)) + echo "least_qunit: '$least_qunit', limit: '$limit'" local free_inodes=$(mdt_free_inodes 0) echo "$free_inodes free inodes on master MDT"