pub struct VfsFileSystem { /* private fields */ }Expand description
The down-adapter: a fuse_backend_rs [FileSystem] over a VFS [Namespace].
Implementations§
Trait Implementations§
Source§impl FileSystem for VfsFileSystem
impl FileSystem for VfsFileSystem
Source§type Inode = u64
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 moreSource§fn init(&self, _capable: FsOptions) -> Result<FsOptions>
fn init(&self, _capable: FsOptions) -> Result<FsOptions>
Initialize the file system. Read more
Source§fn lookup(
&self,
_ctx: &Context,
parent: Self::Inode,
name: &CStr,
) -> Result<Entry>
fn lookup( &self, _ctx: &Context, parent: Self::Inode, name: &CStr, ) -> Result<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)
fn forget(&self, _ctx: &Context, inode: Self::Inode, count: u64)
Forget about an inode. Read more
Source§fn batch_forget(&self, _ctx: &Context, requests: Vec<(Self::Inode, u64)>)
fn batch_forget(&self, _ctx: &Context, requests: Vec<(Self::Inode, u64)>)
Forget about multiple inodes. Read more
Source§fn getattr(
&self,
_ctx: &Context,
inode: Self::Inode,
_handle: Option<Self::Handle>,
) -> Result<(stat64, Duration)>
fn getattr( &self, _ctx: &Context, inode: Self::Inode, _handle: Option<Self::Handle>, ) -> Result<(stat64, Duration)>
Get attributes for a file / directory. Read more
Source§fn opendir(
&self,
_ctx: &Context,
inode: Self::Inode,
_flags: u32,
) -> Result<(Option<Self::Handle>, OpenOptions)>
fn opendir( &self, _ctx: &Context, inode: Self::Inode, _flags: u32, ) -> Result<(Option<Self::Handle>, OpenOptions)>
Open a directory for reading. Read more
Source§fn readdir(
&self,
_ctx: &Context,
inode: Self::Inode,
_handle: Self::Handle,
_size: u32,
offset: u64,
add_entry: &mut dyn FnMut(FuseDirEntry<'_>) -> Result<usize>,
) -> Result<()>
fn readdir( &self, _ctx: &Context, inode: Self::Inode, _handle: Self::Handle, _size: u32, offset: u64, add_entry: &mut dyn FnMut(FuseDirEntry<'_>) -> Result<usize>, ) -> Result<()>
Read a directory. Read more
Source§fn releasedir(
&self,
_ctx: &Context,
_inode: Self::Inode,
_flags: u32,
handle: Self::Handle,
) -> Result<()>
fn releasedir( &self, _ctx: &Context, _inode: Self::Inode, _flags: u32, handle: Self::Handle, ) -> Result<()>
Release an open directory. Read more
Source§fn open(
&self,
_ctx: &Context,
inode: Self::Inode,
flags: u32,
_fuse_flags: u32,
) -> Result<(Option<Self::Handle>, OpenOptions, Option<u32>)>
fn open( &self, _ctx: &Context, inode: Self::Inode, flags: u32, _fuse_flags: u32, ) -> Result<(Option<Self::Handle>, OpenOptions, Option<u32>)>
Open a file. 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,
) -> Result<usize>
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, ) -> Result<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,
) -> Result<usize>
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, ) -> Result<usize>
Write data to 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<()>
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 create(
&self,
_ctx: &Context,
parent: Self::Inode,
name: &CStr,
args: CreateIn,
) -> Result<(Entry, Option<Self::Handle>, OpenOptions, Option<u32>)>
fn create( &self, _ctx: &Context, parent: Self::Inode, name: &CStr, args: CreateIn, ) -> Result<(Entry, Option<Self::Handle>, OpenOptions, Option<u32>)>
Create and open a file. Read more
Source§fn unlink(&self, _ctx: &Context, parent: Self::Inode, name: &CStr) -> Result<()>
fn unlink(&self, _ctx: &Context, parent: Self::Inode, name: &CStr) -> Result<()>
Remove a file. Read more
Source§fn mkdir(
&self,
_ctx: &Context,
parent: Self::Inode,
name: &CStr,
mode: u32,
_umask: u32,
) -> Result<Entry>
fn mkdir( &self, _ctx: &Context, parent: Self::Inode, name: &CStr, mode: u32, _umask: u32, ) -> Result<Entry>
Create a directory. Read more
Source§fn rmdir(&self, _ctx: &Context, parent: Self::Inode, name: &CStr) -> Result<()>
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<()>
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 setattr(
&self,
_ctx: &Context,
inode: Self::Inode,
attr: stat64,
_handle: Option<Self::Handle>,
valid: SetattrValid,
) -> Result<(stat64, Duration)>
fn setattr( &self, _ctx: &Context, inode: Self::Inode, attr: stat64, _handle: Option<Self::Handle>, valid: SetattrValid, ) -> Result<(stat64, Duration)>
Set attributes for a file / directory. Read more
Source§fn symlink(
&self,
_ctx: &Context,
linkname: &CStr,
parent: Self::Inode,
name: &CStr,
) -> Result<Entry>
fn symlink( &self, _ctx: &Context, linkname: &CStr, parent: Self::Inode, name: &CStr, ) -> Result<Entry>
Create a symbolic link. Read more
Source§fn readlink(&self, _ctx: &Context, inode: Self::Inode) -> Result<Vec<u8>>
fn readlink(&self, _ctx: &Context, inode: Self::Inode) -> Result<Vec<u8>>
Read a symbolic link.
Source§fn link(
&self,
_ctx: &Context,
inode: Self::Inode,
newparent: Self::Inode,
newname: &CStr,
) -> Result<Entry>
fn link( &self, _ctx: &Context, inode: Self::Inode, newparent: Self::Inode, newname: &CStr, ) -> Result<Entry>
Create a hard link. Read more
Source§fn access(&self, _ctx: &Context, _inode: Self::Inode, _mask: u32) -> Result<()>
fn access(&self, _ctx: &Context, _inode: Self::Inode, _mask: u32) -> Result<()>
Check file access permissions. Read more
Source§fn getxattr(
&self,
_ctx: &Context,
_inode: Self::Inode,
_name: &CStr,
_size: u32,
) -> Result<GetxattrReply>
fn getxattr( &self, _ctx: &Context, _inode: Self::Inode, _name: &CStr, _size: u32, ) -> Result<GetxattrReply>
Get an extended attribute. Read more
Source§fn listxattr(
&self,
_ctx: &Context,
_inode: Self::Inode,
_size: u32,
) -> Result<ListxattrReply>
fn listxattr( &self, _ctx: &Context, _inode: Self::Inode, _size: u32, ) -> Result<ListxattrReply>
List extended attribute names. Read more
§fn mknod(
&self,
ctx: &Context,
inode: Self::Inode,
name: &CStr,
mode: u32,
rdev: u32,
umask: u32,
) -> Result<Entry, Error>
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 flush(
&self,
ctx: &Context,
inode: Self::Inode,
handle: Self::Handle,
lock_owner: u64,
) -> Result<(), Error>
fn flush( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, lock_owner: u64, ) -> Result<(), Error>
Flush the contents of a file. Read more
§fn fsync(
&self,
ctx: &Context,
inode: Self::Inode,
datasync: bool,
handle: Self::Handle,
) -> Result<(), Error>
fn fsync( &self, ctx: &Context, inode: Self::Inode, datasync: bool, handle: Self::Handle, ) -> Result<(), Error>
Synchronize file contents. Read more
§fn fallocate(
&self,
ctx: &Context,
inode: Self::Inode,
handle: Self::Handle,
mode: u32,
offset: u64,
length: u64,
) -> Result<(), Error>
fn fallocate( &self, ctx: &Context, inode: Self::Inode, handle: Self::Handle, mode: u32, offset: u64, length: u64, ) -> Result<(), Error>
Allocate requested space for file data. Read more
§fn statfs(&self, ctx: &Context, inode: Self::Inode) -> Result<statvfs64, Error>
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>
fn setxattr( &self, ctx: &Context, inode: Self::Inode, name: &CStr, value: &[u8], flags: u32, ) -> Result<(), Error>
Set an extended attribute. Read more
§fn removexattr(
&self,
ctx: &Context,
inode: Self::Inode,
name: &CStr,
) -> Result<(), Error>
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>
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 fsyncdir(
&self,
ctx: &Context,
inode: Self::Inode,
datasync: bool,
handle: Self::Handle,
) -> Result<(), Error>
fn fsyncdir( &self, ctx: &Context, inode: Self::Inode, datasync: bool, handle: Self::Handle, ) -> Result<(), Error>
Synchronize the contents of a directory. Read more
§fn setupmapping(
&self,
_ctx: &Context,
inode: Self::Inode,
handle: Self::Handle,
foffset: u64,
len: u64,
flags: u64,
moffset: u64,
vu_req: &mut (dyn FsCacheReqHandler + 'static),
) -> Result<(), Error>
fn setupmapping( &self, _ctx: &Context, inode: Self::Inode, handle: Self::Handle, foffset: u64, len: u64, flags: u64, moffset: u64, vu_req: &mut (dyn FsCacheReqHandler + 'static), ) -> Result<(), Error>
Setup a mapping so that guest can access files in DAX style. Read more
§fn removemapping(
&self,
_ctx: &Context,
_inode: Self::Inode,
requests: Vec<RemovemappingOne>,
vu_req: &mut (dyn FsCacheReqHandler + 'static),
) -> Result<(), Error>
fn removemapping( &self, _ctx: &Context, _inode: Self::Inode, requests: Vec<RemovemappingOne>, vu_req: &mut (dyn FsCacheReqHandler + 'static), ) -> Result<(), Error>
Teardown a mapping which was setup for guest DAX style access.
§fn lseek(
&self,
ctx: &Context,
inode: Self::Inode,
handle: Self::Handle,
offset: u64,
whence: u32,
) -> Result<u64, Error>
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>
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>
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>
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>
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>
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>
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>
fn notify_reply(&self) -> Result<(), Error>
TODO: support this
Auto Trait Implementations§
impl !Freeze for VfsFileSystem
impl !RefUnwindSafe for VfsFileSystem
impl Send for VfsFileSystem
impl Sync for VfsFileSystem
impl Unpin for VfsFileSystem
impl UnsafeUnpin for VfsFileSystem
impl !UnwindSafe for VfsFileSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more