feat(tvix/castore/fs): instrument FuseDaemon functions
Change-Id: I696b7ab6b4c08004db147c0fda7312bbebaa0eec Reviewed-on: https://cl.tvl.fyi/c/depot/+/10451 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
This commit is contained in:
parent
0af445c2f4
commit
46a372d5d7
1 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::{io, path::Path, sync::Arc, thread};
|
||||
|
||||
use fuse_backend_rs::{api::filesystem::FileSystem, transport::FuseSession};
|
||||
use tracing::error;
|
||||
use tracing::{error, instrument};
|
||||
|
||||
struct FuseServer<FS>
|
||||
where
|
||||
|
@ -52,10 +52,11 @@ pub struct FuseDaemon {
|
|||
}
|
||||
|
||||
impl FuseDaemon {
|
||||
#[instrument(skip(fs, mountpoint), fields(mountpoint=?mountpoint), err)]
|
||||
pub fn new<FS, P>(fs: FS, mountpoint: P, threads: usize) -> Result<Self, io::Error>
|
||||
where
|
||||
FS: FileSystem + Sync + Send + 'static,
|
||||
P: AsRef<Path>,
|
||||
P: AsRef<Path> + std::fmt::Debug,
|
||||
{
|
||||
let server = Arc::new(fuse_backend_rs::api::server::Server::new(Arc::new(fs)));
|
||||
|
||||
|
@ -89,6 +90,7 @@ impl FuseDaemon {
|
|||
})
|
||||
}
|
||||
|
||||
#[instrument(skip_all, err)]
|
||||
pub fn unmount(&mut self) -> Result<(), io::Error> {
|
||||
self.session
|
||||
.umount()
|
||||
|
|
Loading…
Reference in a new issue