From: Hartmut Reuter Date: Fri, 10 Jul 2009 13:46:09 +0000 (+0200) Subject: Make 'fs listquota' output readable for large quota X-Git-Tag: openafs-stable-1_4_12pre1~68 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2edf0120a6638fbff52ace7b368318d5fb120229;p=packages%2Fo%2Fopenafs.git Make 'fs listquota' output readable for large quota With the old print format quota and used values became one large number for quotas in the terabyte range. Fix alignment of the "no limit" string in the Windows fs command for volumes with no quota. Reviewed-on: http://gerrit.openafs.org/34 Verified-by: Russ Allbery Reviewed-by: Russ Allbery Reviewed-by: Jeffrey Altman (cherry picked from commit 42d64b5b1f9944fe35bd6358ebeba9a24162243e) Change-Id: I2dbb186a91df96ec1b0693e8ccd3bda01ac28a48 Reviewed-on: http://gerrit.openafs.org/932 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index c6837beea..7e2761fa5 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -626,10 +626,10 @@ QuickPrintStatus(VolumeStatus *status, char *name) printf("%-25.25s",name); if (status->MaxQuota != 0) { - printf("%10d%10d", status->MaxQuota, status->BlocksInUse); + printf(" %10d %10d", status->MaxQuota, status->BlocksInUse); QuotaUsed = ((((double)status->BlocksInUse)/status->MaxQuota) * 100.0); } else { - printf("no limit%10d", status->BlocksInUse); + printf(" no limit %10d", status->BlocksInUse); } if (QuotaUsed > 90.0){ printf(" %5.0f%%<<", QuotaUsed); @@ -1556,8 +1556,8 @@ ListQuotaCmd(struct cmd_syndesc *as, void *arock) int error = 0; - printf("%-25s%-10s%-10s%-7s%-13s\n", - "Volume Name", " Quota", " Used", " %Used", " Partition"); + printf("%-25s%-11s%-11s%-7s%-13s\n", "Volume Name", " Quota", + " Used", " %Used", " Partition"); SetDotDefault(&as->parms[0].items); for(ti=as->parms[0].items; ti; ti=ti->next) { /* once per file */ diff --git a/src/venus/fs.c b/src/venus/fs.c index d9fe1f787..fb4f4f1db 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -649,11 +649,11 @@ QuickPrintStatus(VolumeStatus * status, char *name) printf("%-25.25s", name); if (status->MaxQuota != 0) { - printf("%10d%10d", status->MaxQuota, status->BlocksInUse); + printf(" %10d %10d", status->MaxQuota, status->BlocksInUse); QuotaUsed = ((((double)status->BlocksInUse) / status->MaxQuota) * 100.0); } else { - printf(" no limit%10d", status->BlocksInUse); + printf(" no limit %10d", status->BlocksInUse); } if (QuotaUsed > 90.0) { printf("%5.0f%%<<", QuotaUsed); @@ -1430,8 +1430,8 @@ ListQuotaCmd(struct cmd_syndesc *as, void *arock) char *name; int error = 0; - printf("%-25s%-10s%-10s%-7s%-11s\n", "Volume Name", " Quota", - " Used", " %Used", " Partition"); + printf("%-25s%-11s%-11s%-7s%-11s\n", "Volume Name", " Quota", + " Used", " %Used", " Partition"); SetDotDefault(&as->parms[0].items); for (ti = as->parms[0].items; ti; ti = ti->next) { /* once per file */