HomeFreeBSD

- Implement -h (human readable) for the size of the underlying block disk.

Description

  • Implement -h (human readable) for the size of the underlying block disk. Currently, the size of the swap device is unconditionally reported using blocks, even if -h has been used.
  • While here, switch to CONVERT_BLOCKS() instead of CONVERT() which will avoid overflowing size counters (in human readable form see: r196244)
  • Update the column headers to reflect that a size is being reported instead of the block size units being used

Before:

$ swapinfo
Device 1K-blocks Used Avail Capacity
/dev/gpt/swapfs 1048576 0 1048576 0%
$

After:

$ swapinfo -h
Device Size Used Avail Capacity
/dev/gpt/swapfs 1.0G 0B 1.0G 0%
$

Differential Revision: https://reviews.freebsd.org/D23758
Reviewed by: kevans
MFC after: 3 weeks

Details

Provenance
csjpAuthored on
Reviewer
kevans
Differential Revision
D23758: Fix output of swapinfo in human readable mode
Parents
rS358180: bhyve: enable virtio-net mergeable rx buffers for tap(4)
Branches
Unknown
Tags
Unknown