fs_block_size -> fs_blocksize, and int to make it consistent
[virt-df.git] / virt-df / virt_df_main.ml
index 84d7cc2..cfe40e2 100644 (file)
@@ -339,7 +339,7 @@ OPTIONS" in
 
     let {
       Diskimage.fs_plugin_id = fs_plugin_id;
-      fs_block_size = fs_block_size;
+      fs_blocksize = fs_blocksize;
       fs_blocks_total = fs_blocks_total;
       fs_is_swap = fs_is_swap;
       fs_blocks_reserved = fs_blocks_reserved;
@@ -350,6 +350,7 @@ OPTIONS" in
       fs_inodes_avail = fs_inodes_avail;
       fs_inodes_used = fs_inodes_used
     } = fs in
+    let fs_blocksize = Int64.of_int fs_blocksize in
 
     let fs_name = Diskimage.name_of_filesystem fs_plugin_id in
 
@@ -357,10 +358,10 @@ OPTIONS" in
       (* Swap partition. *)
       if not !human then
        printf "%10Ld                       %s\n"
-         (fs_block_size *^ fs_blocks_total /^ 1024L) fs_name
+         (fs_blocksize *^ fs_blocks_total /^ 1024L) fs_name
       else
        printf "%10s                       %s\n"
-         (printable_size (fs_block_size *^ fs_blocks_total)) fs_name
+         (printable_size (fs_blocksize *^ fs_blocks_total)) fs_name
     ) else (
       (* Ordinary filesystem. *)
       if not !inodes then (            (* Block display. *)
@@ -371,15 +372,15 @@ OPTIONS" in
 
        if not !human then (            (* Display 1K blocks. *)
          printf "%10Ld %10Ld %10Ld %s\n"
-           (blocks_total *^ fs_block_size /^ 1024L)
-           (fs_blocks_used *^ fs_block_size /^ 1024L)
-           (blocks_avail *^ fs_block_size /^ 1024L)
+           (blocks_total *^ fs_blocksize /^ 1024L)
+           (fs_blocks_used *^ fs_blocksize /^ 1024L)
+           (blocks_avail *^ fs_blocksize /^ 1024L)
            fs_name
        ) else (                        (* Human-readable blocks. *)
          printf "%10s %10s %10s %s\n"
-           (printable_size (blocks_total *^ fs_block_size))
-           (printable_size (fs_blocks_used *^ fs_block_size))
-           (printable_size (blocks_avail *^ fs_block_size))
+           (printable_size (blocks_total *^ fs_blocksize))
+           (printable_size (fs_blocks_used *^ fs_blocksize))
+           (printable_size (blocks_avail *^ fs_blocksize))
            fs_name
        )
       ) else (                         (* Inodes display. *)
@@ -399,7 +400,7 @@ OPTIONS" in
 
     let {
       Diskimage.fs_plugin_id = fs_plugin_id;
-      fs_block_size = fs_block_size;
+      fs_blocksize = fs_blocksize;
       fs_blocks_total = fs_blocks_total;
       fs_is_swap = fs_is_swap;
       fs_blocks_reserved = fs_blocks_reserved;
@@ -410,25 +411,26 @@ OPTIONS" in
       fs_inodes_avail = fs_inodes_avail;
       fs_inodes_used = fs_inodes_used
     } = fs in
+    let fs_blocksize = Int64.of_int fs_blocksize in
 
     let fs_name = Diskimage.name_of_filesystem fs_plugin_id in
 
     let row =
       if fs_is_swap then
        (* Swap partition. *)
-       [ Int64.to_string (fs_block_size *^ fs_blocks_total /^ 1024L);
+       [ Int64.to_string (fs_blocksize *^ fs_blocks_total /^ 1024L);
          ""; "" ]
       else (
        (* Ordinary filesystem. *)
-       if not !inodes then (           (* Block display. *)
+       if not !inodes then (           (* 1K block display. *)
          (* 'df' doesn't count the restricted blocks. *)
          let blocks_total = fs_blocks_total -^ fs_blocks_reserved in
          let blocks_avail = fs_blocks_avail -^ fs_blocks_reserved in
          let blocks_avail = if blocks_avail < 0L then 0L else blocks_avail in
 
-         [ Int64.to_string (blocks_total *^ fs_block_size /^ 1024L);
-           Int64.to_string (fs_blocks_used *^ fs_block_size /^ 1024L);
-           Int64.to_string (blocks_avail *^ fs_block_size /^ 1024L) ]
+         [ Int64.to_string (blocks_total *^ fs_blocksize /^ 1024L);
+           Int64.to_string (fs_blocks_used *^ fs_blocksize /^ 1024L);
+           Int64.to_string (blocks_avail *^ fs_blocksize /^ 1024L) ]
        ) else (                        (* Inodes display. *)
          [ Int64.to_string fs_inodes_total;
            Int64.to_string fs_inodes_used;