From a25b1050ce35f0d62fa9b413698df96649cd6a7b Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Wed, 19 Feb 2025 12:17:40 +0100 Subject: [PATCH] btrfs: rename snapshot parameter 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 --- 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); }); }