Skip to content

Commit

Permalink
refactor: tweak gvfs_fuse.rs due to rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
unknowntpo committed Jan 3, 2025
1 parent 2865395 commit d619db0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions clients/filesystem-fuse/src/fuse_api_handle_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use std::ffi::{OsStr, OsString};
use std::fmt;
use std::num::NonZeroU32;
use std::time::{Duration, SystemTime};
use crate::config::AppConfig;
use crate::fuse_api_handle::FuseApiHandle;

/// Wrapper Struct for `Timestamp` to enable custom Display implementation
Expand Down Expand Up @@ -93,9 +94,9 @@ pub(crate) struct FuseApiHandleDebug<T: RawFileSystem> {
}

impl<T: RawFileSystem> FuseApiHandleDebug<T> {
pub fn new(fs: T, context: FileSystemContext) -> Self {
pub fn new(fs: T, _config: &AppConfig, context: FileSystemContext,) -> Self {
Self {
inner: FuseApiHandle::new(fs, context),
inner: FuseApiHandle::new(fs, _config, context),
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions clients/filesystem-fuse/src/gvfs_fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use once_cell::sync::Lazy;
use std::path::Path;
use std::sync::Arc;
use tokio::sync::Mutex;
use crate::fuse_api_handle_debug::FuseApiHandleDebug;

const FILESET_PREFIX: &str = "gvfs://fileset/";

Expand All @@ -39,8 +40,8 @@ static SERVER: Lazy<Mutex<Option<Arc<FuseServer>>>> = Lazy::new(|| Mutex::new(No
pub(crate) enum CreateFileSystemResult {
Memory(MemoryFileSystem),
Gvfs(GravitinoFilesetFileSystem),
FuseMemoryFs(FuseApiHandle<DefaultRawFileSystem<MemoryFileSystem>>),
FuseGvfs(FuseApiHandle<DefaultRawFileSystem<GravitinoFilesetFileSystem>>),
FuseMemoryFs(FuseApiHandleDebug<DefaultRawFileSystem<MemoryFileSystem>>),
FuseGvfs(FuseApiHandleDebug<DefaultRawFileSystem<GravitinoFilesetFileSystem>>),
None,
}

Expand Down Expand Up @@ -95,15 +96,15 @@ pub async fn create_raw_fs(
) -> GvfsResult<CreateFileSystemResult> {
match path_fs {
CreateFileSystemResult::Memory(fs) => {
let fs = FuseApiHandle::new(
let fs = FuseApiHandleDebug::new(
DefaultRawFileSystem::new(fs, config, &fs_context),
config,
fs_context,
);
Ok(CreateFileSystemResult::FuseMemoryFs(fs))
}
CreateFileSystemResult::Gvfs(fs) => {
let fs = FuseApiHandle::new(
let fs = FuseApiHandleDebug::new(
DefaultRawFileSystem::new(fs, config, &fs_context),
config,
fs_context,
Expand Down

0 comments on commit d619db0

Please sign in to comment.