From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 551AB1FF0AF for ; Fri, 20 Nov 2026 14:33:34 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C155F21802; Fri, 20 Nov 2026 14:33:01 +0100 (CET) From: Lukas Sichert To: pve-devel@lists.proxmox.com Subject: [PATCH storage 1/4] lvm: rename the saferemove throughput parser to parse_throughput Date: Fri, 20 Nov 2026 14:32:40 +0100 Message-ID: <20261120133245.51042-2-l.sichert@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261120133245.51042-1-l.sichert@proxmox.com> References: <20261120133245.51042-1-l.sichert@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795181572496 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.449 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JRUCM62P5IYPGVZXQIHDJ2GDFC2Q7NBE X-Message-ID-Hash: JRUCM62P5IYPGVZXQIHDJ2GDFC2Q7NBE X-MailFrom: l.sichert@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Lukas Sichert X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The parser only handles the value syntax of a throughput limit, so it is not specific to saferemove. Signed-off-by: Lukas Sichert --- 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 c8384d7..3f74cfc 100644 --- a/src/PVE/Storage/LVMPlugin.pm +++ b/src/PVE/Storage/LVMPlugin.pm @@ -684,11 +684,11 @@ my sub blockdev_ioctl_range { # The limit is in bytes per second, with an optional k, m or g suffix for powers of 1024, as taken by # cstream's -t option, which existing configurations were written for. -my sub parse_saferemove_throughput { +my sub parse_throughput { my ($value) = @_; my ($number, $unit) = $value =~ m/^(-?\d+)([kmg])?$/i - or die "invalid saferemove throughput '$value'\n"; + or die "invalid throughput '$value'\n"; my $multiplier = { k => 1024, m => 1024**2, g => 1024**3 }->{ lc($unit // '') } // 1; return $number * $multiplier; @@ -762,7 +762,7 @@ my sub free_lvm_volumes_locked { my $throughput = undef; # discards alone are not rate limited if ($zero_out && (my $value = $scfg->{saferemove_throughput})) { # Normalize zero spellings before selecting the default or dividing by the rate. - $throughput = abs(parse_saferemove_throughput($value)) || undef; + $throughput = abs(parse_throughput($value)) || undef; } if (defined($throughput)) { my $rendered_throughput = render_bytes($throughput); -- 2.47.3