diff --git a/pbs-datastore/Cargo.toml b/pbs-datastore/Cargo.toml index c5eb2353..d24377e6 100644 --- a/pbs-datastore/Cargo.toml +++ b/pbs-datastore/Cargo.toml @@ -10,6 +10,7 @@ anyhow = "1.0" base64 = "0.12" crc32fast = "1" endian_trait = { version = "0.6", features = [ "arrays" ] } +futures = "0.3" libc = "0.2" log = "0.4" nix = "0.19.1" diff --git a/src/backup/cached_chunk_reader.rs b/pbs-datastore/src/cached_chunk_reader.rs similarity index 98% rename from src/backup/cached_chunk_reader.rs rename to pbs-datastore/src/cached_chunk_reader.rs index e88003e4..6cbec98e 100644 --- a/src/backup/cached_chunk_reader.rs +++ b/pbs-datastore/src/cached_chunk_reader.rs @@ -13,10 +13,11 @@ use tokio::io::{AsyncRead, AsyncSeek, ReadBuf}; use proxmox::io_format_err; use proxmox::sys::error::io_err_other; -use pbs_datastore::index::IndexFile; -use pbs_datastore::read_chunk::AsyncReadChunk; use pbs_tools::async_lru_cache::{AsyncCacher, AsyncLruCache}; +use crate::index::IndexFile; +use crate::read_chunk::AsyncReadChunk; + struct AsyncChunkCacher { reader: Arc, } diff --git a/pbs-datastore/src/lib.rs b/pbs-datastore/src/lib.rs index f0765514..b113d0a6 100644 --- a/pbs-datastore/src/lib.rs +++ b/pbs-datastore/src/lib.rs @@ -180,6 +180,7 @@ pub fn backup_group() -> Result { pub mod backup_info; pub mod catalog; +pub mod cached_chunk_reader; pub mod checksum_reader; pub mod checksum_writer; pub mod chunk_stat; diff --git a/src/backup/mod.rs b/src/backup/mod.rs index 6ab3278d..c0ab041c 100644 --- a/src/backup/mod.rs +++ b/src/backup/mod.rs @@ -75,6 +75,7 @@ pub use pbs_datastore::prune::*; pub use pbs_datastore::store_progress::StoreProgress; +pub use pbs_datastore::cached_chunk_reader::*; pub use pbs_datastore::dynamic_index::*; pub use pbs_datastore::fixed_index; pub use pbs_datastore::fixed_index::*; @@ -91,9 +92,6 @@ pub use datastore::*; mod verify; pub use verify::*; -mod cached_chunk_reader; -pub use cached_chunk_reader::*; - pub struct BackupLockGuard(std::fs::File); /// Open or create a lock file owned by user "backup" and lock it. diff --git a/src/bin/proxmox_backup_client/mount.rs b/src/bin/proxmox_backup_client/mount.rs index 6a80b558..70123a36 100644 --- a/src/bin/proxmox_backup_client/mount.rs +++ b/src/bin/proxmox_backup_client/mount.rs @@ -20,12 +20,11 @@ use proxmox::tools::fd::Fd; use pbs_datastore::{BackupDir, BackupGroup, CryptConfig, load_and_decrypt_key}; use pbs_datastore::index::IndexFile; use pbs_datastore::dynamic_index::BufferedDynamicReader; +use pbs_datastore::cached_chunk_reader::CachedChunkReader; use pbs_client::tools::key_source::get_encryption_key_password; use pbs_client::{BackupReader, RemoteChunkReader}; use pbs_tools::json::required_string_param; -use proxmox_backup::backup::CachedChunkReader; - use crate::{ REPO_URL_SCHEMA, extract_repository_from_value,