]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Make 'fs listquota' output readable for large quota
authorHartmut Reuter <reuter@rzg.mpg.de>
Fri, 10 Jul 2009 13:46:09 +0000 (15:46 +0200)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 17 Dec 2009 06:30:17 +0000 (22:30 -0800)
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 <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 42d64b5b1f9944fe35bd6358ebeba9a24162243e)
Change-Id: I2dbb186a91df96ec1b0693e8ccd3bda01ac28a48
Reviewed-on: http://gerrit.openafs.org/932
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/WINNT/afsd/fs.c
src/venus/fs.c

index c6837beea19dd9045f8122f88c202fae9b1adf57..7e2761fa53bc9b998838faff1c536936810c8066 100644 (file)
@@ -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 */
index d9fe1f787ee702fff13e18f49affbac0082679e2..fb4f4f1dbb890f238d5e9cbfb647e4d5c1f10b77 100644 (file)
@@ -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 */