From 4a7f8bbb60c4dd714c65a3d37f5cfdc474ec46a7 Mon Sep 17 00:00:00 2001 From: Brian Meagher Date: Wed, 24 Jan 2024 15:50:14 -0800 Subject: [PATCH] Disable unused expensive code in addVirtualTarget The code to enable all hardware targets before creating virtual ones becomes more expensive as the target count climbs. --- scstadmin/scstadmin.sysfs/scstadmin | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin index 84e539a61..9bfbe5f02 100755 --- a/scstadmin/scstadmin.sysfs/scstadmin +++ b/scstadmin/scstadmin.sysfs/scstadmin @@ -3031,6 +3031,9 @@ sub addVirtualTarget { my $errorString; my $targets; + # Disable this code. Never used but gets expensive as the + # target count climbs. + if (0) { # Enable all hardware targets before creating virtual ones ($targets, $errorString) = $SCST->targets($driver); foreach my $_target (@{$targets}) { @@ -3042,6 +3045,7 @@ sub addVirtualTarget { enableTarget($driver, $_target); } } + } print "\t-> Creating target '$target' for driver '$driver': "; my $rc = $SCST->addVirtualTarget($driver, $target, $attributes);