From 2f682fb89b0b69647a4d27f1de9b4f608b0c7895 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sat, 3 Dec 2016 15:39:54 -0500 Subject: btrfs-progs: utils: negative numbers are more plausible than sizes over 8 EiB I got tired of seeing "16.00EiB" whenever btrfs-progs encounters a negative size value, e.g. during resize: Unallocated: /dev/mapper/datamd18 16.00EiB This version is much more useful: Unallocated: /dev/mapper/datamd18 -26.29GiB Signed-off-by: Zygo Blaxell Reviewed-by: Omar Sandoval Signed-off-by: David Sterba --- utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils.h') diff --git a/utils.h b/utils.h index 366ca292..525bde9f 100644 --- a/utils.h +++ b/utils.h @@ -174,9 +174,9 @@ int check_mounted_where(int fd, const char *file, char *where, int size, int btrfs_device_already_in_root(struct btrfs_root *root, int fd, int super_offset); -int pretty_size_snprintf(u64 size, char *str, size_t str_bytes, unsigned unit_mode); +int pretty_size_snprintf(s64 size, char *str, size_t str_bytes, unsigned unit_mode); #define pretty_size(size) pretty_size_mode(size, UNITS_DEFAULT) -const char *pretty_size_mode(u64 size, unsigned mode); +const char *pretty_size_mode(s64 size, unsigned mode); u64 parse_size(char *s); u64 parse_qgroupid(const char *p); -- cgit v1.2.3