]> 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)
committerJeffrey Altman <jaltman@openafs.org>
Sun, 12 Jul 2009 22:07:34 +0000 (16:07 -0600)
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>
src/WINNT/afsd/fs.c
src/venus/fs.c

index 547234c1f8584b196e9264c31fd0334e437298e3..790a455fcbe327561021abab2519d476d61dc7a4 100644 (file)
@@ -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 */
index 3fee399c4343e9298df6ec735fb68d7e9062d8c2..8a93420c3459adb44d99eeccc1014e6ab5c28146 100644 (file)
@@ -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 */