summaryrefslogtreecommitdiff
path: root/cmds-fi-du.c
Commit message (Collapse)AuthorAge
* btrfs-progs: switch more error messages to common helpersDavid Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: add long options for unitsDavid Sterba2016-03-14
| | | | | | Drop -h, add just the common long options for now. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: switch to u64David Sterba2016-03-14
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: Calculate space shared by each directory arguments file setMark Fasheh2016-03-14
| | | | | | | | | | | | | | Here we define each file set as those found by a recursive search of a single directory argument to btrfs fi du. This isn't as simple as adding up shared extents - they may be shared with each other, and may also overlap. This patch uses an interval tree to store shared extents we find while fiemapping files. After collecting them, a 'set shared' count is calculated by summing (without overlap) each shared region discovered. This is then displayed to the user as 'set shared'. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: filesystem: add 'du' commandMark Fasheh2016-03-14
'btrfs du' differs from regular du in that it will work to resolve which blocks are shared between files in its list. This gives the user a more accurate bytecount from which they can make decisions regarding management of their file space. We still print a total number of bytes counted (like regular du), but also print the number of bytes which were found to have been shared amongst the file set provided. From there it becomes trivial to calculate how much space is exclusively owned. Signed-off-by: Mark Fasheh <mfasheh@suse.de> [ rename files to reflect the filesystem command group, add GPL v2 file headers ] Signed-off-by: David Sterba <dsterba@suse.com>