From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage 1/3] lvm plugin: snapshot info: avoid superfluous argument for closure
Date: Wed, 30 Jul 2025 18:20:55 +0200 [thread overview]
Message-ID: <20250730162117.160498-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250730162117.160498-1-f.ebner@proxmox.com>
The $volname variable is never modified in the function, so it doesn't
need to be passed into the $get_snapname_from_path closure.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/Storage/LVMPlugin.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 67fcfbd..705585f 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -800,7 +800,7 @@ sub volume_snapshot_info {
my ($class, $scfg, $storeid, $volname) = @_;
my $get_snapname_from_path = sub {
- my ($volname, $path) = @_;
+ my ($path) = @_;
my $name = basename($path);
if (my $snapname = parse_snap_name($name)) {
@@ -829,7 +829,7 @@ sub volume_snapshot_info {
my $snapshots = $json_decode;
for my $snap (@$snapshots) {
my $snapfile = $snap->{filename};
- my $snapname = $get_snapname_from_path->($volname, $snapfile);
+ my $snapname = $get_snapname_from_path->($snapfile);
#not a proxmox snapshot
next if !$snapname;
@@ -842,7 +842,7 @@ sub volume_snapshot_info {
my $parentfile = $snap->{'backing-filename'};
if ($parentfile) {
- my $parentname = $get_snapname_from_path->($volname, $parentfile);
+ my $parentname = $get_snapname_from_path->($parentfile);
$info->{$snapname}->{parent} = $parentname;
$info->{$parentname}->{child} = $snapname;
}
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-07-30 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 16:20 [pve-devel] [PATCH-SERIES storage 0/3] fix #6587: lvm plugin: snapshot info: fix parsing snapshot name Fiona Ebner
2025-07-30 16:20 ` Fiona Ebner [this message]
2025-07-30 16:20 ` [pve-devel] [PATCH storage 2/3] " Fiona Ebner
2025-07-30 16:20 ` [pve-devel] [PATCH storage 3/3] lvm plugin: volume snapshot: actually print error when renaming Fiona Ebner
2025-07-30 17:29 ` [pve-devel] [PATCH-SERIES storage 0/3] fix #6587: lvm plugin: snapshot info: fix parsing snapshot name Max R. Carrara
2025-07-30 17:36 ` [pve-devel] applied: " Thomas Lamprecht
2025-07-31 8:34 ` Fiona Ebner
2025-07-31 8:50 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250730162117.160498-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.