- function
- (* Swap partition. *)
- | (target, Swap { swap_name = swap_name;
- swap_block_size = block_size;
- swap_blocks_total = blocks_total }) ->
- if not !human then
- printf "\t%s %Ld %s\n"
- target (block_size *^ blocks_total /^ 1024L) swap_name
- else
- printf "\t%s %s %s\n"
- target (printable_size (block_size *^ blocks_total)) swap_name
-
- (* Ordinary filesystem. *)
- | (target, Filesystem stats) ->
- printf "\t%s " target;
-
- if not !inodes then ( (* Block display. *)
- (* 'df' doesn't count the restricted blocks. *)
- let blocks_total =
- stats.fs_blocks_total -^ stats.fs_blocks_reserved in
- let blocks_avail =
- stats.fs_blocks_avail -^ stats.fs_blocks_reserved in
- let blocks_avail =
- if blocks_avail < 0L then 0L else blocks_avail in
-
- if not !human then ( (* Display 1K blocks. *)
- printf "%Ld %Ld %Ld %s\n"
- (blocks_total *^ stats.fs_block_size /^ 1024L)
- (stats.fs_blocks_used *^ stats.fs_block_size /^ 1024L)
- (blocks_avail *^ stats.fs_block_size /^ 1024L)
- stats.fs_name
- ) else ( (* Human-readable blocks. *)
- printf "%s %s %s %s\n"
- (printable_size (blocks_total *^ stats.fs_block_size))
- (printable_size (stats.fs_blocks_used *^ stats.fs_block_size))
- (printable_size (blocks_avail *^ stats.fs_block_size))
+ fun (target, fs_probe_t) ->
+ let dom_target = dom_name ^ ":" ^ target in
+ printf "%-20s " dom_target;
+
+ match fs_probe_t with
+ (* Swap partition. *)
+ | Swap { swap_name = swap_name;
+ swap_block_size = block_size;
+ swap_blocks_total = blocks_total } ->
+ if not !human then
+ printf "%10Ld %s\n"
+ (block_size *^ blocks_total /^ 1024L) swap_name
+ else
+ printf "%10s %s\n"
+ (printable_size (block_size *^ blocks_total)) swap_name
+
+ (* Ordinary filesystem. *)
+ | Filesystem stats ->
+ if not !inodes then ( (* Block display. *)
+ (* 'df' doesn't count the restricted blocks. *)
+ let blocks_total =
+ stats.fs_blocks_total -^ stats.fs_blocks_reserved in
+ let blocks_avail =
+ stats.fs_blocks_avail -^ stats.fs_blocks_reserved in
+ let blocks_avail =
+ if blocks_avail < 0L then 0L else blocks_avail in
+
+ if not !human then ( (* Display 1K blocks. *)
+ printf "%10Ld %10Ld %10Ld %s\n"
+ (blocks_total *^ stats.fs_block_size /^ 1024L)
+ (stats.fs_blocks_used *^ stats.fs_block_size /^ 1024L)
+ (blocks_avail *^ stats.fs_block_size /^ 1024L)
+ stats.fs_name
+ ) else ( (* Human-readable blocks. *)
+ printf "%10s %10s %10s %s\n"
+ (printable_size (blocks_total *^ stats.fs_block_size))
+ (printable_size (stats.fs_blocks_used *^ stats.fs_block_size))
+ (printable_size (blocks_avail *^ stats.fs_block_size))
+ stats.fs_name
+ )
+ ) else ( (* Inodes display. *)
+ printf "%10Ld %10Ld %10Ld %s\n"
+ stats.fs_inodes_total stats.fs_inodes_used stats.fs_inodes_avail