[pve-devel] [RFC pve-storage 31/36] plugin: lvmthin: update definition of subroutine `activate_lv`

Max Carrara m.carrara at proxmox.com
Wed Jul 17 11:40:29 CEST 2024


.. so that it is not just an anonymous sub assigned to a reference,
but a "proper" private subroutine instead. Also update its call sites
correspondingly.

Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
 src/PVE/Storage/LvmThinPlugin.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/PVE/Storage/LvmThinPlugin.pm b/src/PVE/Storage/LvmThinPlugin.pm
index 1fcafdd..c89b382 100644
--- a/src/PVE/Storage/LvmThinPlugin.pm
+++ b/src/PVE/Storage/LvmThinPlugin.pm
@@ -204,7 +204,7 @@ sub status {
     );
 }
 
-my $activate_lv = sub {
+my sub activate_lv {
     my ($vg, $lv, $cache) = @_;
 
     my $lvs = $cache->{lvs} ||= lvm_list_volumes();
@@ -225,7 +225,7 @@ sub activate_storage {
 
     $class->SUPER::activate_storage($storeid, $scfg, $cache);
 
-    $activate_lv->($scfg->{vgname}, $scfg->{thinpool}, $cache);
+    activate_lv($scfg->{vgname}, $scfg->{thinpool}, $cache);
 }
 
 sub activate_volume {
@@ -234,7 +234,7 @@ sub activate_volume {
     my $vg = $scfg->{vgname};
     my $lv = $snapname ? "snap_${volname}_$snapname" : $volname;
 
-    $activate_lv->($vg, $lv, $cache);
+    activate_lv($vg, $lv, $cache);
 }
 
 sub deactivate_volume {
-- 
2.39.2





More information about the pve-devel mailing list