The real check whether to show deleted or live subvolumes was skipped if
just '-d' was specified without other filters. The 'deleted' filter was
not accounted.
It is now handled as a normal filter, that additionally sets the only_delete
global status in order to be processed before any other filters in
filter_root().
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
BUG_ON(filter >= BTRFS_LIST_FILTER_MAX);
BUG_ON(set->nfilters > set->total);
- if (filter == BTRFS_LIST_FILTER_DELETED) {
- set->only_deleted = 1;
- return 0;
- }
-
if (set->nfilters == set->total) {
size = set->total + BTRFS_LIST_NFILTERS_INCREASE;
size = sizeof(*set) + size * sizeof(struct btrfs_list_filter);
BUG_ON(set->filters[set->nfilters].filter_func);
+ if (filter == BTRFS_LIST_FILTER_DELETED)
+ set->only_deleted = 1;
+
set->filters[set->nfilters].filter_func = all_filter_funcs[filter];
set->filters[set->nfilters].data = data;
set->nfilters++;
{
int i, ret;
- if (!set || !set->nfilters)
+ if (!set)
return 1;
if (set->only_deleted && !ri->deleted)