From 8a23ea46568caaf5bbdabf836577b20a603b0f3d Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 27 Sep 2021 11:10:14 +0200 Subject: [PATCH] move src/backup/read_chunk.rs to pbs-datastore/src/local_chunk_reader.rs --- pbs-datastore/src/lib.rs | 3 +++ .../src/local_chunk_reader.rs | 7 ++++--- src/api2/admin/datastore.rs | 6 ++++-- src/backup/mod.rs | 4 ---- 4 files changed, 11 insertions(+), 9 deletions(-) rename src/backup/read_chunk.rs => pbs-datastore/src/local_chunk_reader.rs (95%) diff --git a/pbs-datastore/src/lib.rs b/pbs-datastore/src/lib.rs index fcc368ff..d50a64a5 100644 --- a/pbs-datastore/src/lib.rs +++ b/pbs-datastore/src/lib.rs @@ -201,3 +201,6 @@ pub use datastore::{check_backup_owner, DataStore}; mod snapshot_reader; pub use snapshot_reader::SnapshotReader; + +mod local_chunk_reader; +pub use local_chunk_reader::LocalChunkReader; diff --git a/src/backup/read_chunk.rs b/pbs-datastore/src/local_chunk_reader.rs similarity index 95% rename from src/backup/read_chunk.rs rename to pbs-datastore/src/local_chunk_reader.rs index 028db311..0f818c03 100644 --- a/src/backup/read_chunk.rs +++ b/pbs-datastore/src/local_chunk_reader.rs @@ -6,9 +6,10 @@ use anyhow::{bail, Error}; use pbs_tools::crypt_config::CryptConfig; use pbs_api_types::CryptMode; -use pbs_datastore::data_blob::DataBlob; -use pbs_datastore::read_chunk::{ReadChunk, AsyncReadChunk}; -use pbs_datastore::DataStore; + +use crate::data_blob::DataBlob; +use crate::read_chunk::{ReadChunk, AsyncReadChunk}; +use crate::DataStore; #[derive(Clone)] pub struct LocalChunkReader { diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 77e24513..97b5b7fa 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -39,7 +39,10 @@ use pbs_api_types::{ Authid, BackupContent, Counts, CryptMode, }; use pbs_client::pxar::create_zip; -use pbs_datastore::{check_backup_owner, DataStore, BackupDir, BackupGroup, StoreProgress, CATALOG_NAME}; +use pbs_datastore::{ + check_backup_owner, DataStore, BackupDir, BackupGroup, StoreProgress, LocalChunkReader, + CATALOG_NAME, +}; use pbs_datastore::backup_info::BackupInfo; use pbs_datastore::cached_chunk_reader::CachedChunkReader; use pbs_datastore::catalog::{ArchiveEntry, CatalogReader}; @@ -60,7 +63,6 @@ use proxmox_rest_server::{WorkerTask, formatter}; use crate::api2::node::rrd::create_value_from_rrd; use crate::backup::{ verify_all_backups, verify_backup_group, verify_backup_dir, verify_filter, - LocalChunkReader, }; use crate::server::jobstate::Job; diff --git a/src/backup/mod.rs b/src/backup/mod.rs index 59078c1d..ca060c9f 100644 --- a/src/backup/mod.rs +++ b/src/backup/mod.rs @@ -3,9 +3,5 @@ // Note: .pcat1 => Proxmox Catalog Format version 1 pub const CATALOG_NAME: &str = "catalog.pcat1.didx"; -// Split -mod read_chunk; -pub use read_chunk::*; - mod verify; pub use verify::*;