]> git.proxmox.com Git - pve-container.git/commitdiff
prepend underscores for is_volume_in_use private helper
authorOguz Bektas <o.bektas@proxmox.com>
Mon, 14 Oct 2019 08:28:47 +0000 (10:28 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 17 Oct 2019 17:39:06 +0000 (19:39 +0200)
this helper was defined twice, once as 'my $is_volume_in_use' sub and
second as a helper sub. as our other helpers with a similar structure,
it is better to prepend the variable sub with two underscores.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
src/PVE/LXC/Config.pm

index 9790345a8fc3739f1a563935373e799191f7e2ba..8517de46dc83829d47e957ec322d3ad7350c683f 100644 (file)
@@ -1281,7 +1281,7 @@ sub classify_mountpoint {
     return 'volume';
 }
 
-my $is_volume_in_use = sub {
+my $__is_volume_in_use = sub {
     my ($class, $config, $volid) = @_;
     my $used = 0;
 
@@ -1299,16 +1299,16 @@ sub is_volume_in_use_by_snapshots {
 
     if (my $snapshots = $config->{snapshots}) {
        foreach my $snap (keys %$snapshots) {
-           return 1 if $is_volume_in_use->($class, $snapshots->{$snap}, $volid);
+           return 1 if $__is_volume_in_use->($class, $snapshots->{$snap}, $volid);
        }
     }
 
     return 0;
-};
+}
 
 sub is_volume_in_use {
     my ($class, $config, $volid, $include_snapshots) = @_;
-    return 1 if $is_volume_in_use->($class, $config, $volid);
+    return 1 if $__is_volume_in_use->($class, $config, $volid);
     return 1 if $include_snapshots && $class->is_volume_in_use_by_snapshots($config, $volid);
     return 0;
 }