From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A53E572489 for ; Mon, 12 Apr 2021 14:40:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9B14D1EB3A for ; Mon, 12 Apr 2021 14:39:53 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 879191EB2B for ; Mon, 12 Apr 2021 14:39:52 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 51570420A0 for ; Mon, 12 Apr 2021 14:39:52 +0200 (CEST) Message-ID: Date: Mon, 12 Apr 2021 14:39:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Thunderbird/88.0 Content-Language: en-US To: Proxmox VE development discussion , Aaron Lauterer References: <20210407142218.29156-1-a.lauterer@proxmox.com> <20210407142218.29156-2-a.lauterer@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210407142218.29156-2-a.lauterer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.043 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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 Subject: [pve-devel] applied: [PATCH v2 storage 1/3] rbd: centralize rbd path concatenation X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2021 12:40:23 -0000 On 07.04.21 16:22, Aaron Lauterer wrote: > The / paths are needed in quite a lot of places. Having one > single place where they are created helps to reduce duplicate code and > makes it easier to introduce new features. > > The 'add_pool_to_disk' sub was already doing that but the name was not > really fitting. This commit renames it to the more general > 'get_rbd_path' and changes the second parameter to the more widely used > $volume instead of $disk. > > Furthermore, all occurences where "$pool/$volume" has been concatenated > have been replaced with a call to get_rbd_path. > > Plus some minor code style cleanups for long function calls that were > touched. > > Signed-off-by: Aaron Lauterer > --- > PVE/Storage/RBDPlugin.pm | 46 +++++++++++++++++++++++----------------- > 1 file changed, 27 insertions(+), 19 deletions(-) > > applied, thanks! I made the $volume optional too in a follow-up, so that it could be reused for an additional case.