From: Oguz Bektas Date: Mon, 14 Oct 2019 08:28:47 +0000 (+0200) Subject: prepend underscores for is_volume_in_use private helper X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=7b4237c5c97a31b9c5354f9fb0823f8108b3cf7c;p=pve-container.git prepend underscores for is_volume_in_use private helper 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 --- diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 9790345..8517de4 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -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; }