mirror of https://github.com/digint/btrbk
btrbk: remove vinfo_subvol_list btrbk_direct_leaf filter
parent
3347a00cea
commit
ef89709d96
12
btrbk
12
btrbk
|
@ -3110,7 +3110,6 @@ sub _vinfo_subtree_list
|
||||||
my $tree = shift;
|
my $tree = shift;
|
||||||
my $vinfo_parent = shift;
|
my $vinfo_parent = shift;
|
||||||
my $filter_readonly = shift; # if set, return only read-only
|
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 $list = shift // [];
|
||||||
my $path_prefix = shift // "";
|
my $path_prefix = shift // "";
|
||||||
my $depth = shift // 0;
|
my $depth = shift // 0;
|
||||||
|
@ -3126,11 +3125,6 @@ sub _vinfo_subtree_list
|
||||||
}
|
}
|
||||||
my $path = $path_prefix . $rel_path; # always points to a subvolume
|
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
|
# filter readonly, push vinfo_child
|
||||||
if(!$filter_readonly || $node->{readonly}) {
|
if(!$filter_readonly || $node->{readonly}) {
|
||||||
my $vinfo = vinfo_child($vinfo_parent, $path);
|
my $vinfo = vinfo_child($vinfo_parent, $path);
|
||||||
|
@ -3142,9 +3136,7 @@ sub _vinfo_subtree_list
|
||||||
push(@$list, $vinfo);
|
push(@$list, $vinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
unless(defined($filter_btrbk_direct_leaf)) {
|
_vinfo_subtree_list($node, $vinfo_parent, $filter_readonly, $list, $path . '/', $depth + 1);
|
||||||
_vinfo_subtree_list($node, $vinfo_parent, $filter_readonly, undef, $list, $path . '/', $depth + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
@ -3158,7 +3150,7 @@ sub vinfo_subvol_list($;@)
|
||||||
TRACE "Creating subvolume list for: $vol->{PRINT}" if($do_trace);
|
TRACE "Creating subvolume list for: $vol->{PRINT}" if($do_trace);
|
||||||
|
|
||||||
# recurse into tree from $vol->{node}, returns arrayref of vinfo
|
# 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}) {
|
||||||
if($opts{sort} eq 'path') {
|
if($opts{sort} eq 'path') {
|
||||||
|
|
Loading…
Reference in New Issue