summaryrefslogtreecommitdiff
path: root/cmds-fi-du.c
Commit message (Collapse)AuthorAge
* btrfs-progs: typo review of strings and commentsNicholas D Steeves2016-06-01
| | | | | Signed-off-by: Nicholas D Steeves <nsteeves@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: switch to negative error codesDavid Sterba2016-05-11
| | | | | | We're using the kernel-style negative error numbers. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fix fi du so it works in more casesAustin S. Hemmelgarn2016-03-30
| | | | | | | | | | | | | | | Currently, btrfs fi du uses open_file_or_dir(), which tries to open it's argument with O_RDWR. Because of POSIX semantics, this fails for non-root users when the file is read-only or is an executable that is being run currently, or for all users (including root) when the filesystem is read-only. This results in a somewhat confusing 'Unknown error -1' message when trying to check such files. Switch to using open_file_or_dir3() with O_RDONLY passed in the flags, as this avoids the limitations listed above, and we have no need to write to the files anyway (and thus shouldn't be opening them writable). Signed-off-by: Austin S. Hemmelgarn <ahferroin7@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: fix incorrect column orderAlexander Fougner2016-03-18
| | | | | Signed-off-by: Alexander Fougner <fougner89@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: make the output more alignedDavid Sterba2016-03-15
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: fi du: update help textDavid Sterba2016-03-15
| | | | | | | Move the command-specific options to the beginning, add missing long option. Signed-off-by: David Sterba <dsterba@suse.com>
* 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>