summaryrefslogtreecommitdiffstats
path: root/cmd/zdb
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-05-02 22:43:53 +0200
committerBrian Behlendorf <[email protected]>2017-05-02 13:43:53 -0700
commite7fbeb606a18b9f04daadddc19b9c4f9a9b34841 (patch)
tree8b9e4a464343553bc5d8b01ca1dd25b917a73990 /cmd/zdb
parent03b60eee78b0bf1125878dbad0fcffd717def61f (diff)
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 <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #2414 Closes #3185 Closes #3594 Closes #6032
Diffstat (limited to 'cmd/zdb')
-rw-r--r--cmd/zdb/zdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index b020b3783..6c4071060 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -3077,7 +3077,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
int sec_remaining =
(zcb->zcb_totalasize - bytes) / 1024 / kb_per_sec;
- zfs_nicenum(bytes, buf, sizeof (buf));
+ zfs_nicebytes(bytes, buf, sizeof (buf));
(void) fprintf(stderr,
"\r%5s completed (%4dMB/s) "
"estimated time remaining: %uhr %02umin %02usec ",