virtiofs

Struct VirtioFs

Source
pub struct VirtioFs { /* private fields */ }
Expand description

Implementation of the virtio-fs file system.

Implementations§

Source§

impl VirtioFs

Source

pub fn new( root_path: impl AsRef<Path>, mount_options: Option<&LxVolumeOptions>, ) -> Result<Self>

Create a new virtio-fs for the specified root path.

Trait Implementations§

Source§

impl Fuse for VirtioFs

Source§

fn init(&self, info: &mut SessionInfo)

Negotiate file system parameters with the client.
Source§

fn get_attr( &self, request: &Request, flags: u32, fh: u64, ) -> Result<fuse_attr_out>

Retrieves the attributes of a file. Read more
Source§

fn set_attr( &self, request: &Request, arg: &fuse_setattr_in, ) -> Result<fuse_attr_out>

Changes the attributes of a file.
Source§

fn lookup(&self, request: &Request, name: &LxStr) -> Result<fuse_entry_out>

Looks up a child of an inode. Read more
Source§

fn forget(&self, node_id: u64, lookup_count: u64)

Tells the FUSE file system to reduce the lookup count of an inode by the specified amount. Read more
Source§

fn open(&self, request: &Request, flags: u32) -> Result<fuse_open_out>

Opens a file. Read more
Source§

fn create( &self, request: &Request, name: &LxStr, arg: &fuse_create_in, ) -> Result<CreateOut>

Create and open a file. Read more
Source§

fn mkdir( &self, request: &Request, name: &LxStr, arg: &fuse_mkdir_in, ) -> Result<fuse_entry_out>

Creates a directory as a child of the specified inode.
Source§

fn mknod( &self, request: &Request, name: &LxStr, arg: &fuse_mknod_in, ) -> Result<fuse_entry_out>

Creates a regular file, fifo, socket, or character or block device node as a child of the specified inode.
Creates a symbolic link as a child of the specified inode.
Creates a hard-link to an existing inode, as a child of the specified inode..
Reads the target of a symbolic link.
Source§

fn read(&self, _request: &Request, arg: &fuse_read_in) -> Result<Vec<u8>>

Reads data from an open file.
Source§

fn write( &self, request: &Request, arg: &fuse_write_in, data: &[u8], ) -> Result<usize>

Writes data to an open file.
Source§

fn release(&self, _request: &Request, arg: &fuse_release_in) -> Result<()>

Closes an open file. Read more
Source§

fn open_dir(&self, request: &Request, flags: u32) -> Result<fuse_open_out>

Opens a directory. Read more
Source§

fn read_dir(&self, _request: &Request, arg: &fuse_read_in) -> Result<Vec<u8>>

Reads the contents of a directory. Read more
Source§

fn read_dir_plus( &self, _request: &Request, arg: &fuse_read_in, ) -> Result<Vec<u8>>

Reads the contents of a directory, and performs a lookup on each entry. Read more
Source§

fn release_dir(&self, request: &Request, arg: &fuse_release_in) -> Result<()>

Closes a directory. Read more
Removes a non-directory child from the specified inode.
Source§

fn rmdir(&self, request: &Request, name: &LxStr) -> Result<()>

Removes a directory child from the specified inode.
Source§

fn rename( &self, request: &Request, name: &LxStr, new_dir: u64, new_name: &LxStr, flags: u32, ) -> Result<()>

Renames a file. Read more
Source§

fn statfs(&self, request: &Request) -> Result<fuse_kstatfs>

Retrieves the attributes of the file system.
Source§

fn fsync(&self, _request: &Request, fh: u64, flags: u32) -> Result<()>

Synchronize file contents.
Source§

fn fsync_dir(&self, request: &Request, fh: u64, flags: u32) -> Result<()>

Synchronize directory contents.
Source§

fn get_xattr( &self, request: &Request, name: &LxStr, size: u32, ) -> Result<Vec<u8>>

Retrieve an extended attribute on an inode.
Source§

fn get_xattr_size(&self, request: &Request, name: &LxStr) -> Result<u32>

Retrieve the size of an extended attribute on an inode.
Source§

fn set_xattr( &self, request: &Request, name: &LxStr, value: &[u8], flags: u32, ) -> Result<()>

Add or change an extended attribute on an inode.
Source§

fn list_xattr(&self, request: &Request, size: u32) -> Result<Vec<u8>>

List all extended attributes on an inode.
Source§

fn list_xattr_size(&self, request: &Request) -> Result<u32>

Retrieve the size of the list of extended attributes on an inode.
Source§

fn remove_xattr(&self, request: &Request, name: &LxStr) -> Result<()>

Remove an extended attribute from an inode.
Source§

fn destroy(&self)

Clean up the file system. Read more
Source§

fn flush(&self, _request: &Request, _arg: &fuse_flush_in) -> Result<(), Error>

Called on each close() of a file descriptor for an opened file. Read more
Source§

fn get_lock( &self, _request: &Request, _arg: &fuse_lk_in, ) -> Result<fuse_file_lock, Error>

Test for a POSIX file lock.
Source§

fn set_lock( &self, _request: &Request, _arg: &fuse_lk_in, _sleep: bool, ) -> Result<(), Error>

Acquire, modify or release a POSIX file lock. Read more
Source§

fn access(&self, _request: &Request, _mask: u32) -> Result<(), Error>

Check file access permissions.
Source§

fn block_map( &self, _request: &Request, _block: u64, _block_size: u32, ) -> Result<u64, Error>

Map a file block index to a device block index. Read more
Source§

fn ioctl( &self, _request: &Request, _arg: &fuse_ioctl_in, _data: &[u8], ) -> Result<(i32, Vec<u8>), Error>

Submit an ioctl. Read more
Source§

fn fallocate( &self, _request: &Request, _arg: &fuse_fallocate_in, ) -> Result<(), Error>

Allocate requested space.
Source§

fn lseek( &self, _request: &Request, _fh: u64, _offset: u64, _whence: u32, ) -> Result<u64, Error>

Find data holes in a sparse file.
Source§

fn copy_file_range( &self, _request: &Request, _arg: &fuse_copy_file_range_in, ) -> Result<usize, Error>

Copy data from one file to another without needing to send data through the FUSE kernel module.
Source§

fn setup_mapping( &self, request: &Request, mapper: &dyn Mapper, arg: &fuse_setupmapping_in, ) -> Result<(), Error>

Create a DAX memory mapping.
Source§

fn remove_mapping( &self, request: &Request, mapper: &dyn Mapper, moffset: u64, len: u64, ) -> Result<(), Error>

Remove a DAX memory mapping.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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