diff options
author | David Sterba <dsterba@suse.cz> | 2013-10-23 19:00:09 +0200 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-10-24 05:57:44 -0400 |
commit | 4fc17596aaa2b03ee38c467585465923d62b1510 (patch) | |
tree | 46453ce5137b7e87370006229d4d46ceb1f3e1fb /cmds-subvolume.c | |
parent | b91d84abc0df2195aaa06a79b565d8852b3099b2 (diff) |
btrfs-progs: add filter for deleted but uncleanded subvolumes
New option to subvolume list that acts as a global filter and applies
the other filters to either live subvolumes or the uncleaned ones.
The path to the deleted subvolumes is lost at the deletion time, sample
output looks like:
ID 259 gen 7 top level 0 path <FS_TREE>/DELETED
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r-- | cmds-subvolume.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 63c708ef..76dab1f4 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -317,6 +317,7 @@ static const char * const cmd_subvol_list_usage[] = { "-t print the result as a table", "-s list snapshots only in the filesystem", "-r list readonly subvolumes (including snapshots)", + "-d list deleted subvolumes that are not yet cleaned", "-G [+|-]value", " filter the subvolumes by generation", " (+value: >= value; -value: <= value; value: = value)", @@ -355,7 +356,7 @@ static int cmd_subvol_list(int argc, char **argv) optind = 1; while(1) { c = getopt_long(argc, argv, - "acgopqsurG:C:t", long_options, NULL); + "acdgopqsurG:C:t", long_options, NULL); if (c < 0) break; @@ -369,6 +370,11 @@ static int cmd_subvol_list(int argc, char **argv) case 'c': btrfs_list_setup_print_column(BTRFS_LIST_OGENERATION); break; + case 'd': + btrfs_list_setup_filter(&filter_set, + BTRFS_LIST_FILTER_DELETED, + 0); + break; case 'g': btrfs_list_setup_print_column(BTRFS_LIST_GENERATION); break; |