From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C16261FF17E for ; Thu, 13 Nov 2025 10:30:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9DEA116294; Thu, 13 Nov 2025 10:31:30 +0100 (CET) From: Nicolas Frey To: pbs-devel@lists.proxmox.com Date: Thu, 13 Nov 2025 10:31:11 +0100 Message-ID: <20251113093118.195229-6-n.frey@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251113093118.195229-1-n.frey@proxmox.com> References: <20251113093118.195229-1-n.frey@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.100 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pbs-devel] [PATCH proxmox-backup v4 2/9] verify: introduce new state struct X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" to prepare for better bundling when introducing parallel chunk loading Suggested-by: Christian Ebner Signed-off-by: Nicolas Frey --- src/backup/verify.rs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/backup/verify.rs b/src/backup/verify.rs index 2871f1a6..e8ea49b2 100644 --- a/src/backup/verify.rs +++ b/src/backup/verify.rs @@ -1,6 +1,6 @@ use pbs_config::BackupLockGuard; use std::collections::HashSet; -use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; use std::time::Instant; @@ -34,6 +34,34 @@ pub struct VerifyWorker { backend: DatastoreBackend, } +struct IndexVerifyState { + read_bytes: AtomicU64, + decoded_bytes: AtomicU64, + errors: AtomicUsize, + datastore: Arc, + corrupt_chunks: Arc>>, + verified_chunks: Arc>>, + start_time: Instant, +} + +impl IndexVerifyState { + fn new( + datastore: &Arc, + corrupt_chunks: &Arc>>, + verified_chunks: &Arc>>, + ) -> Self { + Self { + read_bytes: AtomicU64::new(0), + decoded_bytes: AtomicU64::new(0), + errors: AtomicUsize::new(0), + datastore: Arc::clone(datastore), + corrupt_chunks: Arc::clone(corrupt_chunks), + verified_chunks: Arc::clone(verified_chunks), + start_time: Instant::now(), + } + } +} + impl VerifyWorker { /// Creates a new VerifyWorker for a given task worker and datastore. pub fn new( -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel