aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools/Shared/disk_backend.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ManaTools/Shared/disk_backend.pm')
-rw-r--r--lib/ManaTools/Shared/disk_backend.pm16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/ManaTools/Shared/disk_backend.pm b/lib/ManaTools/Shared/disk_backend.pm
index 7159c667..9bacf9b4 100644
--- a/lib/ManaTools/Shared/disk_backend.pm
+++ b/lib/ManaTools/Shared/disk_backend.pm
@@ -363,6 +363,11 @@ sub probeio {
=head2 findin
+=head3 INPUT
+
+ $io: ManaTools::Shared::disk_backend::IO
+ $state: ManaTools::Shared::disk_backend::Part::PartState|undef
+
=head3 OUTPUT
array of Part
@@ -377,14 +382,20 @@ sub probeio {
sub findin {
my $self = shift;
my $io = shift;
+ my $state = shift;
- return grep {grep {$io eq $_} $_->get_ins()} @{$self->parts};
+ return grep {grep {$io eq $_} $_->get_ins() && (!defined $state || $_->is_state($state))} @{$self->parts};
}
#=============================================================
=head2 findout
+=head3 INPUT
+
+ $io: ManaTools::Shared::disk_backend::IO
+ $state: ManaTools::Shared::disk_backend::Part::PartState|undef
+
=head3 OUTPUT
array of Part
@@ -399,8 +410,9 @@ sub findin {
sub findout {
my $self = shift;
my $io = shift;
+ my $state = shift;
- return grep {grep {$io eq $_} $_->get_outs()} @{$self->parts};
+ return grep {grep {$io eq $_} $_->get_outs() && (!defined $state || $_->is_state($state))} @{$self->parts};
}
#=============================================================