From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ronja.mits.lan by ronja.mits.lan with LMTP id eGJLDLrvc2YuNQAAxxbTJA (envelope-from ); Thu, 20 Jun 2024 11:00:42 +0200 Received: from proxmox-new.maurer-it.com (unknown [192.168.2.33]) by ronja.mits.lan (Postfix) with ESMTPS id 1D985F64607; Thu, 20 Jun 2024 11:00:42 +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 009DD47D4A; Thu, 20 Jun 2024 11:00:42 +0200 (CEST) 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 (4096 bits)) (No client certificate requested) by proxmox-new.maurer-it.com (Proxmox) with ESMTPS; Thu, 20 Jun 2024 11:00:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CE4FB12371; Thu, 20 Jun 2024 11:00:40 +0200 (CEST) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Thu, 20 Jun 2024 11:00:07 +0200 Message-Id: <20240620090008.1823043-3-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240620090008.1823043-1-m.sandoval@proxmox.com> References: <20240620090008.1823043-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Subject: [pbs-devel] [PATCH backup 3/4] datastore: use std::mem::ofset_of! 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" X-SPAM-LEVEL: Spam detection results: 0 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 MAILING_LIST_MULTI -2 Multiple indicators imply a widely-seen list manager 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_NONE 0.001 SPF: sender does not publish an SPF Record T_SCC_BODY_TEXT_LINE -0.01 - Requires Rust 1.77.0. Signed-off-by: Maximiliano Sandoval --- pbs-datastore/src/data_blob.rs | 4 ++-- pbs-datastore/src/dynamic_index.rs | 2 +- pbs-datastore/src/fixed_index.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pbs-datastore/src/data_blob.rs b/pbs-datastore/src/data_blob.rs index 4119c4a4..e3039354 100644 --- a/pbs-datastore/src/data_blob.rs +++ b/pbs-datastore/src/data_blob.rs @@ -56,13 +56,13 @@ impl DataBlob { /// accessor to crc32 checksum pub fn crc(&self) -> u32 { - let crc_o = proxmox_lang::offsetof!(DataBlobHeader, crc); + let crc_o = std::mem::offset_of!(DataBlobHeader, crc); u32::from_le_bytes(self.raw_data[crc_o..crc_o + 4].try_into().unwrap()) } // set the CRC checksum field pub fn set_crc(&mut self, crc: u32) { - let crc_o = proxmox_lang::offsetof!(DataBlobHeader, crc); + let crc_o = std::mem::offset_of!(DataBlobHeader, crc); self.raw_data[crc_o..crc_o + 4].copy_from_slice(&crc.to_le_bytes()); } diff --git a/pbs-datastore/src/dynamic_index.rs b/pbs-datastore/src/dynamic_index.rs index dc9eee05..0e99ce58 100644 --- a/pbs-datastore/src/dynamic_index.rs +++ b/pbs-datastore/src/dynamic_index.rs @@ -353,7 +353,7 @@ impl DynamicIndexWriter { self.writer.flush()?; - let csum_offset = proxmox_lang::offsetof!(DynamicIndexHeader, index_csum); + let csum_offset = std::mem::offset_of!(DynamicIndexHeader, index_csum); self.writer.seek(SeekFrom::Start(csum_offset as u64))?; let csum = self.csum.take().unwrap(); diff --git a/pbs-datastore/src/fixed_index.rs b/pbs-datastore/src/fixed_index.rs index 9ed943fa..d67c388e 100644 --- a/pbs-datastore/src/fixed_index.rs +++ b/pbs-datastore/src/fixed_index.rs @@ -349,7 +349,7 @@ impl FixedIndexWriter { self.unmap()?; - let csum_offset = proxmox_lang::offsetof!(FixedIndexHeader, index_csum); + let csum_offset = std::mem::offset_of!(FixedIndexHeader, index_csum); self.file.seek(SeekFrom::Start(csum_offset as u64))?; self.file.write_all(&index_csum)?; self.file.flush()?; -- 2.39.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel