From cef5c72682252651df431d91f0266961c77107ae Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 14 Sep 2021 07:42:06 +0200 Subject: [PATCH] move src/tape/helpers/snapshot_reader.rs to src/backup/snapshot_reader.rs --- src/api2/tape/backup.rs | 3 +-- src/backup/mod.rs | 3 +++ src/{tape/helpers => backup}/snapshot_reader.rs | 0 src/tape/file_formats/snapshot_archive.rs | 11 +++++------ src/tape/helpers/mod.rs | 2 -- src/tape/mod.rs | 3 --- src/tape/pool_writer/mod.rs | 5 +---- src/tape/pool_writer/new_chunks_iterator.rs | 9 ++------- 8 files changed, 12 insertions(+), 24 deletions(-) rename src/{tape/helpers => backup}/snapshot_reader.rs (100%) delete mode 100644 src/tape/helpers/mod.rs diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs index 39e5feea..9342eb59 100644 --- a/src/api2/tape/backup.rs +++ b/src/api2/tape/backup.rs @@ -35,14 +35,13 @@ use crate::{ compute_schedule_status, }, }, - backup::DataStore, + backup::{DataStore, SnapshotReader}, server::WorkerTask, tape::{ TAPE_STATUS_DIR, Inventory, PoolWriter, MediaPool, - SnapshotReader, drive::{ media_changer, lock_tape_device, diff --git a/src/backup/mod.rs b/src/backup/mod.rs index 8c2780b5..d9aacd16 100644 --- a/src/backup/mod.rs +++ b/src/backup/mod.rs @@ -12,3 +12,6 @@ pub use datastore::*; mod verify; pub use verify::*; + +mod snapshot_reader; +pub use snapshot_reader::SnapshotReader; diff --git a/src/tape/helpers/snapshot_reader.rs b/src/backup/snapshot_reader.rs similarity index 100% rename from src/tape/helpers/snapshot_reader.rs rename to src/backup/snapshot_reader.rs diff --git a/src/tape/file_formats/snapshot_archive.rs b/src/tape/file_formats/snapshot_archive.rs index 56c3e9c1..c898dc4a 100644 --- a/src/tape/file_formats/snapshot_archive.rs +++ b/src/tape/file_formats/snapshot_archive.rs @@ -12,12 +12,11 @@ use pbs_tape::{ TapeWrite, MediaContentHeader, }; -use crate::tape::{ - SnapshotReader, - file_formats::{ - PROXMOX_BACKUP_SNAPSHOT_ARCHIVE_MAGIC_1_1, - SnapshotArchiveHeader, - }, +use crate::backup::SnapshotReader; + +use crate::tape::file_formats::{ + PROXMOX_BACKUP_SNAPSHOT_ARCHIVE_MAGIC_1_1, + SnapshotArchiveHeader, }; diff --git a/src/tape/helpers/mod.rs b/src/tape/helpers/mod.rs deleted file mode 100644 index 3fd8f4b0..00000000 --- a/src/tape/helpers/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod snapshot_reader; -pub use snapshot_reader::*; diff --git a/src/tape/mod.rs b/src/tape/mod.rs index 0acc8748..5d4d46f1 100644 --- a/src/tape/mod.rs +++ b/src/tape/mod.rs @@ -14,9 +14,6 @@ mod test; pub mod file_formats; -mod helpers; -pub use helpers::*; - mod media_set; pub use media_set::*; diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs index b2663543..8042de9e 100644 --- a/src/tape/pool_writer/mod.rs +++ b/src/tape/pool_writer/mod.rs @@ -21,15 +21,12 @@ use pbs_tape::{ }; use crate::{ - backup::{ - DataStore, - }, + backup::{DataStore, SnapshotReader}, server::WorkerTask, tape::{ TAPE_STATUS_DIR, MAX_CHUNK_ARCHIVE_SIZE, COMMIT_BLOCK_SIZE, - SnapshotReader, MediaPool, MediaId, MediaCatalog, diff --git a/src/tape/pool_writer/new_chunks_iterator.rs b/src/tape/pool_writer/new_chunks_iterator.rs index 8b3bdd45..68fcc857 100644 --- a/src/tape/pool_writer/new_chunks_iterator.rs +++ b/src/tape/pool_writer/new_chunks_iterator.rs @@ -5,13 +5,8 @@ use anyhow::{format_err, Error}; use pbs_datastore::DataBlob; -use crate::{ - backup::DataStore, - tape::{ - CatalogSet, - SnapshotReader, - }, -}; +use crate::backup::{DataStore, SnapshotReader}; +use crate::tape::CatalogSet; /// Chunk iterator which use a separate thread to read chunks ///