]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- Implement -h (human readable) for the size of the underlying block disk.
authorChristian S.J. Peron <csjp@FreeBSD.org>
Thu, 20 Feb 2020 21:12:10 +0000 (21:12 +0000)
committerChristian S.J. Peron <csjp@FreeBSD.org>
Thu, 20 Feb 2020 21:12:10 +0000 (21:12 +0000)
commit9a990500e5e0959c7a82aa6035d7a52ba33b7f6f
tree2ff31326951e1c4862a44760ba8f9ce601f42b00
parentf92bb8c19af0a06a957877dc6326c55d95136553
- 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
usr.sbin/pstat/pstat.c