move src/backup/snapshot_reader.rs to pbs_datastore crate

This commit is contained in:
Dietmar Maurer 2021-09-27 09:58:20 +02:00
parent b446fa14c5
commit c95c1c83b0
7 changed files with 13 additions and 17 deletions

View File

@ -198,3 +198,6 @@ pub use store_progress::StoreProgress;
mod datastore; mod datastore;
pub use datastore::{check_backup_owner, DataStore}; pub use datastore::{check_backup_owner, DataStore};
mod snapshot_reader;
pub use snapshot_reader::SnapshotReader;

View File

@ -6,12 +6,12 @@ use std::fs::File;
use anyhow::{bail, Error}; use anyhow::{bail, Error};
use nix::dir::Dir; use nix::dir::Dir;
use pbs_datastore::backup_info::BackupDir; use crate::backup_info::BackupDir;
use pbs_datastore::index::IndexFile; use crate::index::IndexFile;
use pbs_datastore::fixed_index::FixedIndexReader; use crate::fixed_index::FixedIndexReader;
use pbs_datastore::dynamic_index::DynamicIndexReader; use crate::dynamic_index::DynamicIndexReader;
use pbs_datastore::manifest::{archive_type, ArchiveType, CLIENT_LOG_BLOB_NAME, MANIFEST_BLOB_NAME}; use crate::manifest::{archive_type, ArchiveType, CLIENT_LOG_BLOB_NAME, MANIFEST_BLOB_NAME};
use pbs_datastore::DataStore; use crate::DataStore;
use pbs_tools::fs::lock_dir_noblock_shared; use pbs_tools::fs::lock_dir_noblock_shared;
/// Helper to access the contents of a datastore backup snapshot /// Helper to access the contents of a datastore backup snapshot

View File

@ -20,7 +20,7 @@ use pbs_api_types::{
UPID_SCHEMA, JOB_ID_SCHEMA, PRIV_DATASTORE_READ, PRIV_TAPE_AUDIT, PRIV_TAPE_WRITE, UPID_SCHEMA, JOB_ID_SCHEMA, PRIV_DATASTORE_READ, PRIV_TAPE_AUDIT, PRIV_TAPE_WRITE,
}; };
use pbs_datastore::{DataStore, StoreProgress}; use pbs_datastore::{DataStore, StoreProgress, SnapshotReader};
use pbs_datastore::backup_info::{BackupDir, BackupInfo}; use pbs_datastore::backup_info::{BackupDir, BackupInfo};
use pbs_tools::{task_log, task_warn, task::WorkerTaskContext}; use pbs_tools::{task_log, task_warn, task::WorkerTaskContext};
use pbs_config::CachedUserInfo; use pbs_config::CachedUserInfo;
@ -36,7 +36,6 @@ use crate::{
compute_schedule_status, compute_schedule_status,
}, },
}, },
backup::SnapshotReader,
tape::{ tape::{
TAPE_STATUS_DIR, TAPE_STATUS_DIR,
Inventory, Inventory,

View File

@ -9,6 +9,3 @@ pub use read_chunk::*;
mod verify; mod verify;
pub use verify::*; pub use verify::*;
mod snapshot_reader;
pub use snapshot_reader::SnapshotReader;

View File

@ -11,8 +11,7 @@ use pbs_tape::{
PROXMOX_TAPE_BLOCK_SIZE, PROXMOX_TAPE_BLOCK_SIZE,
TapeWrite, MediaContentHeader, TapeWrite, MediaContentHeader,
}; };
use pbs_datastore::SnapshotReader;
use crate::backup::SnapshotReader;
use crate::tape::file_formats::{ use crate::tape::file_formats::{
PROXMOX_BACKUP_SNAPSHOT_ARCHIVE_MAGIC_1_1, PROXMOX_BACKUP_SNAPSHOT_ARCHIVE_MAGIC_1_1,

View File

@ -19,11 +19,10 @@ use pbs_tape::{
TapeWrite, TapeWrite,
sg_tape::tape_alert_flags_critical, sg_tape::tape_alert_flags_critical,
}; };
use pbs_datastore::DataStore; use pbs_datastore::{DataStore, SnapshotReader};
use proxmox_rest_server::WorkerTask; use proxmox_rest_server::WorkerTask;
use crate::{ use crate::{
backup::SnapshotReader,
tape::{ tape::{
TAPE_STATUS_DIR, TAPE_STATUS_DIR,
MAX_CHUNK_ARCHIVE_SIZE, MAX_CHUNK_ARCHIVE_SIZE,

View File

@ -3,9 +3,8 @@ use std::sync::{Arc, Mutex};
use anyhow::{format_err, Error}; use anyhow::{format_err, Error};
use pbs_datastore::{DataStore, DataBlob}; use pbs_datastore::{DataStore, DataBlob, SnapshotReader};
use crate::backup::SnapshotReader;
use crate::tape::CatalogSet; use crate::tape::CatalogSet;
/// Chunk iterator which use a separate thread to read chunks /// Chunk iterator which use a separate thread to read chunks