[pve-devel] [PATCH storage v4 7/7] btrfs: rename snapshot parameter

Maximiliano Sandoval m.sandoval at proxmox.com
Wed Feb 19 12:17:40 CET 2025


It was originally introduced as $snapshot to match the argument name of
foreach_subvol, we rename it here to make it clear that it only contains
the snapshot name.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 src/PVE/Storage/BTRFSPlugin.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
index c82d5f7..a28996c 100644
--- a/src/PVE/Storage/BTRFSPlugin.pm
+++ b/src/PVE/Storage/BTRFSPlugin.pm
@@ -407,18 +407,18 @@ my sub path_is_subvolume : prototype($) {
 
 my $BTRFS_SNAPSHOT_REGEX = qr/((?:vm|base|subvol)-\d+-disk-\d+(?:\.subvol)?)(?:\@(\S+))$/;
 
-# Calls `$code->($snapshot)` for each snapshot of the BTRFS subvolume.
+# Calls `$code->($snap_name)` for each snapshot of the BTRFS subvolume.
 my sub foreach_snapshot_of_subvol : prototype($$) {
     my ($subvol, $code) = @_;
 
     my $basename = basename($subvol);
     my $dir = dirname($subvol);
     dir_glob_foreach($dir, $BTRFS_SNAPSHOT_REGEX, sub {
-	my ($volume, $name, $snapshot) = ($1, $2, $3);
+	my ($volume, $name, $snap_name) = ($1, $2, $3);
 	return if !path_is_subvolume("$dir/$volume");
 	return if $name ne $basename;
-	return if !defined $snapshot;
-	$code->($snapshot);
+	return if !defined $snap_name;
+	$code->($snap_name);
     });
 }
 
-- 
2.39.5





More information about the pve-devel mailing list