From 97dee277b06570cfd9cc661e2e900dcc7ad2ede8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 16 Dec 2023 23:01:50 +0200 Subject: 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 Reviewed-by: raitobezarius --- tvix/store/src/fs/mod.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'tvix/store/src') diff --git a/tvix/store/src/fs/mod.rs b/tvix/store/src/fs/mod.rs index cb2d2154e78d..fbd1cb6fc5e1 100644 --- a/tvix/store/src/fs/mod.rs +++ b/tvix/store/src/fs/mod.rs @@ -16,6 +16,7 @@ use fuse_backend_rs::abi::fuse_abi::stat64; use fuse_backend_rs::api::filesystem::{Context, FileSystem, FsOptions, ROOT_ID}; use futures::StreamExt; use parking_lot::RwLock; +use std::ops::Deref; use std::{ collections::HashMap, io, @@ -72,9 +73,9 @@ use self::{ /// 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 /// allocation", aka reserve Directory.size inodes for each PathInfo. -pub struct TvixStoreFs { - blob_service: Arc, - directory_service: Arc, +pub struct TvixStoreFs { + blob_service: BS, + directory_service: DS, root_nodes_provider: RN, /// Whether to (try) listing elements in the root. @@ -95,13 +96,15 @@ pub struct TvixStoreFs { tokio_handle: tokio::runtime::Handle, } -impl TvixStoreFs +impl TvixStoreFs where + BS: Deref + Clone + Send, + DS: Deref + Clone + Send + 'static, RN: RootNodes + Clone + 'static, { pub fn new( - blob_service: Arc, - directory_service: Arc, + blob_service: BS, + directory_service: DS, root_nodes_provider: RN, list_root: bool, ) -> Self { @@ -262,8 +265,10 @@ where } } -impl FileSystem for TvixStoreFs +impl FileSystem for TvixStoreFs where + BS: Deref + Clone + Send + 'static, + DS: Deref + Send + Clone + 'static, RN: RootNodes + Clone + 'static, { type Handle = u64; -- cgit 1.4.1