diff options
author | LOLi <[email protected]> | 2017-05-02 22:43:53 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-05-02 13:43:53 -0700 |
commit | e7fbeb606a18b9f04daadddc19b9c4f9a9b34841 (patch) | |
tree | 8b9e4a464343553bc5d8b01ca1dd25b917a73990 /include | |
parent | 03b60eee78b0bf1125878dbad0fcffd717def61f (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 'include')
-rw-r--r-- | include/libzfs.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/libzfs.h b/include/libzfs.h index 433616ffb..1240c23d2 100644 --- a/include/libzfs.h +++ b/include/libzfs.h @@ -773,8 +773,9 @@ extern int zfs_deleg_share_nfs(libzfs_handle_t *, char *, char *, char *, enum zfs_nicenum_format { ZFS_NICENUM_1024 = 0, - ZFS_NICENUM_TIME = 1, - ZFS_NICENUM_RAW = 2 + ZFS_NICENUM_BYTES = 1, + ZFS_NICENUM_TIME = 2, + ZFS_NICENUM_RAW = 3 }; /* @@ -786,6 +787,7 @@ extern void zfs_nicenum_format(uint64_t num, char *buf, size_t buflen, extern void zfs_nicetime(uint64_t, char *, size_t); +extern void zfs_nicebytes(uint64_t, char *, size_t); extern int zfs_nicestrtonum(libzfs_handle_t *, const char *, uint64_t *); /* |