From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C6D0F1FF2F6 for ; Wed, 29 May 2024 13:54:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A3A974EA5; Wed, 29 May 2024 13:55:16 +0200 (CEST) Message-ID: <9a0222a9-1544-4f4c-90ac-27119b599c34@proxmox.com> Date: Wed, 29 May 2024 13:54:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox Backup Server development discussion , Christian Ebner References: <20240528094303.309806-1-c.ebner@proxmox.com> <20240528094303.309806-7-c.ebner@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20240528094303.309806-7-c.ebner@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [sync.rs] Subject: Re: [pbs-devel] [PATCH v8 pxar 06/69] encoder: allow split output writer for archive creation 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" one tiny nit inline, but that does not warrant a new version IMHO, just maybe consider it if you send a new version anyway On 5/28/24 11:42, Christian Ebner wrote: [snip] > diff --git a/src/encoder/sync.rs b/src/encoder/sync.rs > index 48a97af..9d39658 100644 > --- a/src/encoder/sync.rs > +++ b/src/encoder/sync.rs > @@ -9,7 +9,7 @@ use crate::decoder::sync::StandardReader; > use crate::encoder::{self, LinkOffset, SeqWrite}; > use crate::format; > use crate::util::poll_result_once; > -use crate::Metadata; > +use crate::{Metadata, PxarVariant}; > > /// Blocking `pxar` encoder. > /// > @@ -28,7 +28,7 @@ impl<'a, T: io::Write + 'a> Encoder<'a, StandardWriter> { > /// Encode a `pxar` archive into a regular `std::io::Write` output. > #[inline] > pub fn from_std(output: T, metadata: &Metadata) -> io::Result>> { > - Encoder::new(StandardWriter::new(output), metadata) > + Encoder::new(PxarVariant::Unified(StandardWriter::new(output)), metadata) > } > } > > @@ -39,7 +39,7 @@ impl<'a> Encoder<'a, StandardWriter> { > metadata: &'b Metadata, > ) -> io::Result>> { > Encoder::new( > - StandardWriter::new(std::fs::File::create(path.as_ref())?), > + PxarVariant::Unified(StandardWriter::new(std::fs::File::create(path.as_ref())?)), > metadata, > ) > } > @@ -50,9 +50,18 @@ impl<'a, T: SeqWrite + 'a> Encoder<'a, T> { > /// > /// Note that the `output`'s `SeqWrite` implementation must always return `Poll::Ready` and is > /// not allowed to use the `Waker`, as this will cause a `panic!`. > - pub fn new(output: T, metadata: &Metadata) -> io::Result { > + // Optionally attach a dedicated writer to redirect the payloads of regular files to a separate > + // output. > + pub fn new(output: PxarVariant, metadata: &Metadata) -> io::Result { > + let output = match output { > + PxarVariant::Unified(output) => PxarVariant::Unified(output.into()), > + PxarVariant::Split(output, payload_output) => { > + PxarVariant::Split(output.into(), payload_output) > + } > + }; > + nit: this could be shortened with the `wrap_multi` helper: output.wrap_multi(|a| a.into, |p| p); and then it could probably be inlined as well > Ok(Self { > - inner: poll_result_once(encoder::EncoderImpl::new(output.into(), metadata))?, > + inner: poll_result_once(encoder::EncoderImpl::new(output, metadata))?, > }) > } > _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel