Displaying 1 result from an estimated 1 matches for "human_round_to_nearest".
2017 Dec 12
2
[PATCH] df: Handle block sizes smaller than 1024 bytes (RHBZ#1525241).
...const char *name, const char *uuid_param,
@@ -95,7 +111,7 @@ print_stat (FILE *fp,
 #define MAX_LEN (LONGEST_HUMAN_READABLE > 128 ? LONGEST_HUMAN_READABLE : 128)
   char buf[4][MAX_LEN];
   const char *cols[4];
-  int64_t factor, v;
+  int64_t v;
   float percent;
   const int hopts =
     human_round_to_nearest|human_autoscale|human_base_1024|human_SI;
@@ -109,15 +125,13 @@ print_stat (FILE *fp,
 
   if (!inodes) {                /* 1K blocks */
     if (!human) {
-      factor = stat->bsize / 1024;
-
-      v = stat->blocks * factor;
+      v = scale (stat->blocks, stat->bsize, 1024);...