move chunk_stat, read_chunk to pbs-datastore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-07-08 09:17:28 +02:00
parent ae24382634
commit e64f38cb6b
8 changed files with 72 additions and 56 deletions

View File

@ -1,20 +1,22 @@
//! An async and concurrency safe data reader backed by a local LRU cache.
use anyhow::Error;
use futures::future::Future;
use futures::ready;
use tokio::io::{AsyncRead, AsyncSeek, ReadBuf};
use std::future::Future;
use std::io::SeekFrom;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use super::{AsyncReadChunk, IndexFile};
use crate::tools::async_lru_cache::{AsyncCacher, AsyncLruCache};
use anyhow::Error;
use futures::ready;
use tokio::io::{AsyncRead, AsyncSeek, ReadBuf};
use proxmox::io_format_err;
use proxmox::sys::error::io_err_other;
use pbs_datastore::read_chunk::AsyncReadChunk;
use super::IndexFile;
use crate::tools::async_lru_cache::{AsyncCacher, AsyncLruCache};
struct AsyncChunkCacher<T> {
reader: Arc<T>,
}