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 2D10C1FF2AA for ; Wed, 3 Jul 2024 15:57:13 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9BA0997B2; Wed, 3 Jul 2024 15:57:29 +0200 (CEST) Mime-Version: 1.0 Date: Wed, 03 Jul 2024 15:57:25 +0200 Message-Id: From: "Max Carrara" To: "Proxmox Backup Server development discussion" X-Mailer: aerc 0.17.0-72-g6a84f1331f1c References: <20240626145801.751326-1-m.sandoval@proxmox.com> <20240626145801.751326-2-m.sandoval@proxmox.com> In-Reply-To: <20240626145801.751326-2-m.sandoval@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [compression.rs, mod.rs, zip.rs, lib.rs] Subject: Re: [pbs-devel] [PATCH promox v4 1/5] compression: deflate: move encoder into a mod 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" On Wed Jun 26, 2024 at 4:57 PM CEST, Maximiliano Sandoval wrote: > This allows to add a decompression mod inside the deflate mod. This does > not touch the public API. > > Signed-off-by: Maximiliano Sandoval > --- This patch unfortunately doesn't apply for me. I'm on the latest master. Could you please rebase this? Thanks! > proxmox-compression/src/{ => deflate}/compression.rs | 6 ++---- > proxmox-compression/src/deflate/mod.rs | 5 +++++ > proxmox-compression/src/lib.rs | 4 ++-- > proxmox-compression/src/zip.rs | 2 +- > 4 files changed, 10 insertions(+), 7 deletions(-) > rename proxmox-compression/src/{ => deflate}/compression.rs (97%) > create mode 100644 proxmox-compression/src/deflate/mod.rs > > diff --git a/proxmox-compression/src/compression.rs b/proxmox-compression/src/deflate/compression.rs > similarity index 97% > rename from proxmox-compression/src/compression.rs > rename to proxmox-compression/src/deflate/compression.rs > index 632a5991..6e6a151d 100644 > --- a/proxmox-compression/src/compression.rs > +++ b/proxmox-compression/src/deflate/compression.rs > @@ -12,8 +12,6 @@ use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; > use proxmox_io::ByteBuffer; > use proxmox_lang::io_format_err; > > -const BUFFER_SIZE: usize = 8192; > - > pub enum Level { > Fastest, > Best, > @@ -53,7 +51,7 @@ impl DeflateEncoder { > Self { > inner, > compressor: Compress::new(level, false), > - buffer: ByteBuffer::with_capacity(BUFFER_SIZE), > + buffer: ByteBuffer::with_capacity(super::BUFFER_SIZE), > input_buffer: Bytes::new(), > state: EncoderState::Reading, > } > @@ -109,7 +107,7 @@ impl DeflateEncoder { > where > R: AsyncRead + Unpin, > { > - let mut buffer = ByteBuffer::with_capacity(BUFFER_SIZE); > + let mut buffer = ByteBuffer::with_capacity(super::BUFFER_SIZE); > let mut eof = false; > loop { > if !eof && !buffer.is_full() { > diff --git a/proxmox-compression/src/deflate/mod.rs b/proxmox-compression/src/deflate/mod.rs > new file mode 100644 > index 00000000..514ccbdc > --- /dev/null > +++ b/proxmox-compression/src/deflate/mod.rs > @@ -0,0 +1,5 @@ > +mod compression; > + > +pub use compression::{DeflateEncoder, Level}; > + > +const BUFFER_SIZE: usize = 8192; > diff --git a/proxmox-compression/src/lib.rs b/proxmox-compression/src/lib.rs > index 1fcfb977..70d88afe 100644 > --- a/proxmox-compression/src/lib.rs > +++ b/proxmox-compression/src/lib.rs > @@ -1,6 +1,6 @@ > -mod compression; > -pub use compression::*; > +pub use deflate::{DeflateEncoder, Level}; > > +mod deflate; > pub mod tar; > pub mod zip; > pub mod zstd; > diff --git a/proxmox-compression/src/zip.rs b/proxmox-compression/src/zip.rs > index d2d3fd80..3ccece9b 100644 > --- a/proxmox-compression/src/zip.rs > +++ b/proxmox-compression/src/zip.rs > @@ -22,7 +22,7 @@ use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt, ReadBuf}; > use crc32fast::Hasher; > use proxmox_time::gmtime; > > -use crate::compression::{DeflateEncoder, Level}; > +use crate::deflate::{DeflateEncoder, Level}; > > const LOCAL_FH_SIG: u32 = 0x04034B50; > const LOCAL_FF_SIG: u32 = 0x08074B50; _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel