Struct btfuse::fuse_fs::private::FuseFs

source ·
pub struct FuseFs<P> {
    provider: P,
    path_by_luid: Bijection<u32, Arc<BlockPath>>,
    ruid_by_path: RwLock<Bijection<Arc<BlockPath>, u32>>,
}

Fields§

§provider: P§path_by_luid: Bijection<u32, Arc<BlockPath>>§ruid_by_path: RwLock<Bijection<Arc<BlockPath>, u32>>

Implementations§

source§

impl<P> FuseFs<P>

source

pub fn new(provider: P, fallback_path: Arc<BlockPath>) -> Self

source

fn path_from_luid(&self, luid: u32) -> &Arc<BlockPath>

source

fn luid_from_ruid(&self, ruid: u32) -> Result<u32>

source

fn convert_ruid(&self, attrs: BlockMetaSecrets) -> Result<BlockMetaSecrets>

source

fn fuse_entry(&self, attrs: Entry) -> Result<Entry>

source§

impl<P: 'static + FsProvider> FuseFs<P>

source

async fn load_authz_attrs( provider: &P, from: &Arc<BlockPath>, path: &BlockPath ) -> Result<AuthzAttrs>

Trait Implementations§

source§

impl<P: 'static + FsProvider> FileSystem for FuseFs<P>

§

type Inode = u64

Represents a location in the filesystem tree and can be used to perform operations that act on the metadata of a file/directory (e.g., getattr and setattr). Can also be used as the starting point for looking up paths in the filesystem tree. An Inode may support operating directly on the content of the path that to which it points. FileSystem implementations that support this should set the FsOptions::ZERO_MESSAGE_OPEN option in the return value of the init function. On linux based systems, an Inode is equivalent to opening a file or directory with the libc::O_PATH flag. Read more
§

type Handle = u64

Represents a file or directory that is open for reading/writing.
source§

fn init(&self, _capable: FsOptions) -> Result<FsOptions>

Initialize the file system. Read more
source§

fn lookup( &self, ctx: &Context, parent: Self::Inode, name: &CStr ) -> IoResult<Entry>

Look up a directory entry by name and get its attributes. Read more
source§

fn forget(&self, ctx: &Context, inode: Self::Inode, count: u64)

Forget about an inode. Read more
source§

fn create( &self, ctx: &Context, parent: Self::Inode, name: &CStr, args: CreateIn ) -> IoResult<(Entry, Option<Self::Handle>, OpenOptions)>

Create and open a file. Read more
source§

fn mkdir( &self, ctx: &Context, parent: Self::Inode, name: &CStr, mode: u32, umask: u32 ) -> Result<Entry>

Create a directory. Read more
source§

fn open( &self, ctx: &Context, inode: Self::Inode, flags: u32, _fuse_flags: u32 ) -> IoResult<(Option<Self::Handle>, OpenOptions)>

Open a file. Read more
source§

fn release( &self, ctx: &Context, inode: Self::Inode, flags: u32, handle: Self::Handle, _flush: bool, _flock_release: bool, _lock_owner: Option<u64> ) -> Result<()>

Release an open file. Read more
source§

fn opendir( &self, ctx: &Context, inode: Self::Inode, flags: u32 ) -> IoResult<(Option<Self::Handle>, OpenOptions)>

Open a directory for reading. Read more
source§

fn releasedir( &self, ctx: &Context, inode: Self::Inode, _flags: u32, handle: Self::Handle ) -> Result<()>

Release an open directory. Read more
source§

fn read( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, w: &mut dyn ZeroCopyWriter, size: u32, offset: u64, _lock_owner: Option<u64>, _flags: u32 ) -> IoResult<usize>

Read data from a file. Read more
source§

fn write( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, r: &mut dyn ZeroCopyReader, size: u32, offset: u64, _lock_owner: Option<u64>, _delayed_write: bool, _flags: u32, _fuse_flags: u32 ) -> IoResult<usize>

Write data to a file. Read more
source§

fn flush( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, _lock_owner: u64 ) -> Result<()>

Flush the contents of a file. Read more
source§

fn readdir( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, size: u32, offset: u64, add_entry: &mut dyn FnMut(DirEntry<'_>) -> Result<usize> ) -> Result<()>

Read a directory. Read more
Create a hard link. Read more
Remove a file. Read more
source§

fn rmdir(&self, ctx: &Context, parent: Self::Inode, name: &CStr) -> Result<()>

Remove a directory. Read more
source§

fn rename( &self, ctx: &Context, olddir: Self::Inode, oldname: &CStr, newdir: Self::Inode, newname: &CStr, _flags: u32 ) -> Result<()>

Rename a file / directory. Read more
source§

fn getattr( &self, ctx: &Context, inode: Self::Inode, handle: Option<Self::Handle> ) -> IoResult<(stat64, Duration)>

Get attributes for a file / directory. Read more
source§

fn setattr( &self, ctx: &Context, inode: Self::Inode, attr: stat64, handle: Option<Self::Handle>, valid: SetattrValid ) -> IoResult<(stat64, Duration)>

Set attributes for a file / directory. Read more
source§

fn fsync( &self, ctx: &Context, inode: Self::Inode, _datasync: bool, handle: Self::Handle ) -> IoResult<()>

Synchronize file contents. Read more
source§

fn fsyncdir( &self, ctx: &Context, inode: Self::Inode, datasync: bool, handle: Self::Handle ) -> IoResult<()>

Synchronize the contents of a directory. Read more
source§

fn fallocate( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, mode: u32, offset: u64, length: u64 ) -> IoResult<()>

Allocate requested space for file data. Read more
§

fn destroy(&self)

Clean up the file system. Read more
§

fn batch_forget(&self, ctx: &Context, requests: Vec<(Self::Inode, u64), Global>)

Forget about multiple inodes. Read more
Read a symbolic link.
Create a symbolic link. Read more
§

fn mknod( &self, ctx: &Context, inode: Self::Inode, name: &CStr, mode: u32, rdev: u32, umask: u32 ) -> Result<Entry, Error>

Create a file node. Read more
§

fn statfs(&self, ctx: &Context, inode: Self::Inode) -> Result<statvfs64, Error>

Get information about the file system.
§

fn setxattr( &self, ctx: &Context, inode: Self::Inode, name: &CStr, value: &[u8], flags: u32 ) -> Result<(), Error>

Set an extended attribute. Read more
§

fn getxattr( &self, ctx: &Context, inode: Self::Inode, name: &CStr, size: u32 ) -> Result<GetxattrReply, Error>

Get an extended attribute. Read more
§

fn listxattr( &self, ctx: &Context, inode: Self::Inode, size: u32 ) -> Result<ListxattrReply, Error>

List extended attribute names. Read more
§

fn removexattr( &self, ctx: &Context, inode: Self::Inode, name: &CStr ) -> Result<(), Error>

Remove an extended attribute. Read more
§

fn readdirplus( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, size: u32, offset: u64, add_entry: &mut dyn FnMut(DirEntry<'_>, Entry) -> Result<usize, Error> ) -> Result<(), Error>

Read a directory with entry attributes. Read more
§

fn access( &self, ctx: &Context, inode: Self::Inode, mask: u32 ) -> Result<(), Error>

Check file access permissions. Read more
§

fn lseek( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, offset: u64, whence: u32 ) -> Result<u64, Error>

Reposition read/write file offset.
§

fn getlk( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, owner: u64, lock: FileLock, flags: u32 ) -> Result<FileLock, Error>

Query file lock status
§

fn setlk( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, owner: u64, lock: FileLock, flags: u32 ) -> Result<(), Error>

Grab a file read lock
§

fn setlkw( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, owner: u64, lock: FileLock, flags: u32 ) -> Result<(), Error>

Grab a file write lock
§

fn ioctl( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, flags: u32, cmd: u32, data: IoctlData<'_>, out_size: u32 ) -> Result<IoctlData<'_>, Error>

send ioctl to the file
§

fn bmap( &self, ctx: &Context, inode: Self::Inode, block: u64, blocksize: u32 ) -> Result<u64, Error>

Query a file’s block mapping info
§

fn poll( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, khandle: Self::Handle, flags: u32, events: u32 ) -> Result<u32, Error>

Poll a file’s events
§

fn notify_reply(&self) -> Result<(), Error>

TODO: support this
source§

impl<P: Sync> Sync for FuseFs<P>

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for FuseFs<P>where P: RefUnwindSafe,

§

impl<P> Send for FuseFs<P>where P: Send,

§

impl<P> Unpin for FuseFs<P>where P: Unpin,

§

impl<P> UnwindSafe for FuseFs<P>where P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Free for T

§

unsafe default fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more