refactor(tvix/store/fs): no explicitly required Arc'ed Blob/DirSvc
Change-Id: Ie55026668cd4a6117e7b07174f5ac6638f93d194 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10374 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
parent
6815572274
commit
97dee277b0
1 changed files with 12 additions and 7 deletions
|
@ -16,6 +16,7 @@ use fuse_backend_rs::abi::fuse_abi::stat64;
|
||||||
use fuse_backend_rs::api::filesystem::{Context, FileSystem, FsOptions, ROOT_ID};
|
use fuse_backend_rs::api::filesystem::{Context, FileSystem, FsOptions, ROOT_ID};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
use std::ops::Deref;
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
io,
|
io,
|
||||||
|
@ -72,9 +73,9 @@ use self::{
|
||||||
/// Due to the above being valid across the whole store, and considering the
|
/// Due to the above being valid across the whole store, and considering the
|
||||||
/// merkle structure is a DAG, not a tree, this also means we can't do "bucketed
|
/// merkle structure is a DAG, not a tree, this also means we can't do "bucketed
|
||||||
/// allocation", aka reserve Directory.size inodes for each PathInfo.
|
/// allocation", aka reserve Directory.size inodes for each PathInfo.
|
||||||
pub struct TvixStoreFs<RN> {
|
pub struct TvixStoreFs<BS, DS, RN> {
|
||||||
blob_service: Arc<dyn BlobService>,
|
blob_service: BS,
|
||||||
directory_service: Arc<dyn DirectoryService>,
|
directory_service: DS,
|
||||||
root_nodes_provider: RN,
|
root_nodes_provider: RN,
|
||||||
|
|
||||||
/// Whether to (try) listing elements in the root.
|
/// Whether to (try) listing elements in the root.
|
||||||
|
@ -95,13 +96,15 @@ pub struct TvixStoreFs<RN> {
|
||||||
tokio_handle: tokio::runtime::Handle,
|
tokio_handle: tokio::runtime::Handle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<RN> TvixStoreFs<RN>
|
impl<BS, DS, RN> TvixStoreFs<BS, DS, RN>
|
||||||
where
|
where
|
||||||
|
BS: Deref<Target = dyn BlobService> + Clone + Send,
|
||||||
|
DS: Deref<Target = dyn DirectoryService> + Clone + Send + 'static,
|
||||||
RN: RootNodes + Clone + 'static,
|
RN: RootNodes + Clone + 'static,
|
||||||
{
|
{
|
||||||
pub fn new(
|
pub fn new(
|
||||||
blob_service: Arc<dyn BlobService>,
|
blob_service: BS,
|
||||||
directory_service: Arc<dyn DirectoryService>,
|
directory_service: DS,
|
||||||
root_nodes_provider: RN,
|
root_nodes_provider: RN,
|
||||||
list_root: bool,
|
list_root: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
@ -262,8 +265,10 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<RN> FileSystem for TvixStoreFs<RN>
|
impl<BS, DS, RN> FileSystem for TvixStoreFs<BS, DS, RN>
|
||||||
where
|
where
|
||||||
|
BS: Deref<Target = dyn BlobService> + Clone + Send + 'static,
|
||||||
|
DS: Deref<Target = dyn DirectoryService> + Send + Clone + 'static,
|
||||||
RN: RootNodes + Clone + 'static,
|
RN: RootNodes + Clone + 'static,
|
||||||
{
|
{
|
||||||
type Handle = u64;
|
type Handle = u64;
|
||||||
|
|
Loading…
Reference in a new issue