* [PATCH] btrfs-progs: device usage: report slack space
@ 2016-05-17 14:31 David Sterba
0 siblings, 0 replies; only message in thread
From: David Sterba @ 2016-05-17 14:31 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
The total filesystem space on a given device might be smaller than the
device size. We should report that space as well. The original idea was
to report the 'occupied' size but the term was not all clear, so the
logic was reversed to report the slack space.
Signed-off-by: David Sterba <dsterba@suse.com>
---
cmds-fi-usage.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c
index 23820066ce26..b26ece1d2ece 100644
--- a/cmds-fi-usage.c
+++ b/cmds-fi-usage.c
@@ -1024,13 +1024,8 @@ void print_device_sizes(int fd, struct device_info *devinfo, unsigned unit_mode)
printf(" Device size: %*s%10s\n",
(int)(20 - strlen("Device size")), "",
pretty_size_mode(devinfo->device_size, unit_mode));
-#if 0
- /*
- * The term has not seen an agreement and we don't want to change it
- * once it's in non-development branches or even released.
- */
- printf(" FS occupied: %*s%10s\n",
- (int)(20 - strlen("FS occupied")), "",
- pretty_size_mode(devinfo->size, unit_mode));
-#endif
+ printf(" Device slack: %*s%10s\n",
+ (int)(20 - strlen("Device slack")), "",
+ pretty_size_mode(devinfo->device_size - devinfo->size,
+ unit_mode));
}
--
2.7.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-17 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17 14:31 [PATCH] btrfs-progs: device usage: report slack space David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).