From 071045ef35ba0cc6735de8f07d71fb73091bfbd8 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. (cherry picked from commit b1425b556970e5673b826eda0be6c52f719fa13f) --- scstadmin/scstadmin.sysfs/scstadmin | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin index 79f7dee0f..4ca226015 100755 --- a/scstadmin/scstadmin.sysfs/scstadmin +++ b/scstadmin/scstadmin.sysfs/scstadmin @@ -3024,6 +3024,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}) { @@ -3035,6 +3038,7 @@ sub addVirtualTarget { enableTarget($driver, $_target); } } + } print "\t-> Creating target '$target' for driver '$driver': "; my $rc = $SCST->addVirtualTarget($driver, $target, $attributes);