]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
Add zfs_nicebytes() to print human-readable sizes
authorLOLi <loli10K@users.noreply.github.com>
Tue, 2 May 2017 20:43:53 +0000 (22:43 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 May 2017 20:43:53 +0000 (13:43 -0700)
commite7fbeb606a18b9f04daadddc19b9c4f9a9b34841
tree8b9e4a464343553bc5d8b01ca1dd25b917a73990
parent03b60eee78b0bf1125878dbad0fcffd717def61f
Add zfs_nicebytes() to print human-readable sizes

* Add zfs_nicebytes() to print human-readable sizes

Some 'zfs', 'zpool' and 'zdb' output strings can be confusing to the
user when no units are specified. This add a new zfs_nicenum_format
"ZFS_NICENUM_BYTES" used to print bytes in their human-readable form.

Additionally, update some test cases to use machine-parsable 'zfs get'.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #2414
Closes #3185
Closes #3594
Closes #6032
17 files changed:
cmd/zdb/zdb.c
cmd/zfs/zfs_main.c
cmd/zpool/zpool_main.c
include/libzfs.h
lib/libzfs/libzfs_dataset.c
lib/libzfs/libzfs_pool.c
lib/libzfs/libzfs_sendrecv.c
lib/libzfs/libzfs_status.c
lib/libzfs/libzfs_util.c
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies_002_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zfs_create/properties.kshlib
tests/zfs-tests/tests/functional/cli_root/zfs_create/zfs_create_common.kshlib
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_004_pos.ksh
tests/zfs-tests/tests/functional/userquota/userquota_common.kshlib