From 42d64b5b1f9944fe35bd6358ebeba9a24162243e Mon Sep 17 00:00:00 2001 From: Hartmut Reuter Date: Fri, 10 Jul 2009 15:46:09 +0200 Subject: [PATCH] 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 --- src/WINNT/afsd/fs.c | 8 ++++---- src/venus/fs.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index 547234c1f..790a455fc 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -666,10 +666,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); @@ -1714,8 +1714,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 3fee399c4..8a93420c3 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -650,11 +650,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); @@ -1493,8 +1493,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 */ -- 2.39.5