From ef89709d967f57c225a98977b00a44cc4554de02 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 26 Jun 2022 17:13:39 +0200 Subject: [PATCH] btrbk: remove vinfo_subvol_list btrbk_direct_leaf filter --- btrbk | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/btrbk b/btrbk index 44b47b3..7dda83a 100755 --- a/btrbk +++ b/btrbk @@ -3110,7 +3110,6 @@ sub _vinfo_subtree_list my $tree = shift; my $vinfo_parent = shift; my $filter_readonly = shift; # if set, return only read-only - my $filter_btrbk_direct_leaf = shift; # if set, return only read-only direct leafs matching btrbk_basename my $list = shift // []; my $path_prefix = shift // ""; my $depth = shift // 0; @@ -3126,11 +3125,6 @@ sub _vinfo_subtree_list } my $path = $path_prefix . $rel_path; # always points to a subvolume - # filter direct leafs (SUBVOL_DIR="") matching btrbk_basename - next unless(!defined($filter_btrbk_direct_leaf) || - (exists($node->{BTRBK_BASENAME}) && ($node->{BTRBK_BASENAME} eq $filter_btrbk_direct_leaf) && - ($rel_path !~ /\//))); # note: depth is always 0 if $filter_btrbk_direct_leaf - # filter readonly, push vinfo_child if(!$filter_readonly || $node->{readonly}) { my $vinfo = vinfo_child($vinfo_parent, $path); @@ -3142,9 +3136,7 @@ sub _vinfo_subtree_list push(@$list, $vinfo); } - unless(defined($filter_btrbk_direct_leaf)) { - _vinfo_subtree_list($node, $vinfo_parent, $filter_readonly, undef, $list, $path . '/', $depth + 1); - } + _vinfo_subtree_list($node, $vinfo_parent, $filter_readonly, $list, $path . '/', $depth + 1); } return $list; } @@ -3158,7 +3150,7 @@ sub vinfo_subvol_list($;@) TRACE "Creating subvolume list for: $vol->{PRINT}" if($do_trace); # recurse into tree from $vol->{node}, returns arrayref of vinfo - my $subvol_list = _vinfo_subtree_list($vol->{node}, $vol, $opts{readonly}, $opts{btrbk_direct_leaf}); + my $subvol_list = _vinfo_subtree_list($vol->{node}, $vol, $opts{readonly}); if($opts{sort}) { if($opts{sort} eq 'path') {