pub struct ZeroOpenLayer<L>{ /* private fields */ }Expand description
Wrap a handleless [Layer] so it presents a non-None handle to
OverlayFs. See the module docs.
Implementations§
Trait Implementations§
Source§impl<L> FileSystem for ZeroOpenLayer<L>
impl<L> FileSystem for ZeroOpenLayer<L>
Source§fn open(
&self,
ctx: &Context,
inode: u64,
flags: u32,
fuse_flags: u32,
) -> Result<(Option<u64>, OpenOptions, Option<u32>)>
fn open( &self, ctx: &Context, inode: u64, flags: u32, fuse_flags: u32, ) -> Result<(Option<u64>, OpenOptions, Option<u32>)>
Substitute a constant handle when the inner layer is handleless.
Source§fn opendir(
&self,
ctx: &Context,
inode: u64,
flags: u32,
) -> Result<(Option<u64>, OpenOptions)>
fn opendir( &self, ctx: &Context, inode: u64, flags: u32, ) -> Result<(Option<u64>, OpenOptions)>
Substitute a constant handle when the inner layer is handleless.
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 lookup(&self, ctx: &Context, parent: u64, name: &CStr) -> Result<Entry>
fn lookup(&self, ctx: &Context, parent: u64, name: &CStr) -> Result<Entry>
Look up a directory entry by name and get its attributes. Read more
Source§fn batch_forget(&self, ctx: &Context, requests: Vec<(u64, u64)>)
fn batch_forget(&self, ctx: &Context, requests: Vec<(u64, u64)>)
Forget about multiple inodes. Read more
Source§fn getattr(
&self,
ctx: &Context,
inode: u64,
handle: Option<u64>,
) -> Result<(stat64, Duration)>
fn getattr( &self, ctx: &Context, inode: u64, handle: Option<u64>, ) -> Result<(stat64, Duration)>
Get attributes for a file / directory. Read more
Source§fn setattr(
&self,
ctx: &Context,
inode: u64,
attr: stat64,
handle: Option<u64>,
valid: SetattrValid,
) -> Result<(stat64, Duration)>
fn setattr( &self, ctx: &Context, inode: u64, attr: stat64, handle: Option<u64>, valid: SetattrValid, ) -> Result<(stat64, Duration)>
Set attributes for a file / directory. Read more
Source§fn unlink(&self, ctx: &Context, parent: u64, name: &CStr) -> Result<()>
fn unlink(&self, ctx: &Context, parent: u64, name: &CStr) -> Result<()>
Remove a file. Read more
Source§fn rmdir(&self, ctx: &Context, parent: u64, name: &CStr) -> Result<()>
fn rmdir(&self, ctx: &Context, parent: u64, name: &CStr) -> Result<()>
Remove a directory. Read more
Source§fn read(
&self,
ctx: &Context,
inode: u64,
handle: u64,
w: &mut dyn ZeroCopyWriter,
size: u32,
offset: u64,
lock_owner: Option<u64>,
flags: u32,
) -> Result<usize>
fn read( &self, ctx: &Context, inode: u64, handle: u64, 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: u64,
handle: u64,
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: u64, handle: u64, 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: u64,
flags: u32,
handle: u64,
flush: bool,
flock_release: bool,
lock_owner: Option<u64>,
) -> Result<()>
fn release( &self, ctx: &Context, inode: u64, flags: u32, handle: u64, flush: bool, flock_release: bool, lock_owner: Option<u64>, ) -> Result<()>
Release an open file. Read more
Source§fn statfs(&self, ctx: &Context, inode: u64) -> Result<statvfs64>
fn statfs(&self, ctx: &Context, inode: u64) -> Result<statvfs64>
Get information about the file system.
Source§fn getxattr(
&self,
ctx: &Context,
inode: u64,
name: &CStr,
size: u32,
) -> Result<GetxattrReply>
fn getxattr( &self, ctx: &Context, inode: u64, name: &CStr, size: u32, ) -> Result<GetxattrReply>
Get an extended attribute. Read more
Source§fn listxattr(
&self,
ctx: &Context,
inode: u64,
size: u32,
) -> Result<ListxattrReply>
fn listxattr( &self, ctx: &Context, inode: u64, size: u32, ) -> Result<ListxattrReply>
List extended attribute names. Read more
Source§fn readdir(
&self,
ctx: &Context,
inode: u64,
handle: u64,
size: u32,
offset: u64,
add_entry: &mut dyn FnMut(DirEntry<'_>) -> Result<usize>,
) -> Result<()>
fn readdir( &self, ctx: &Context, inode: u64, handle: u64, size: u32, offset: u64, add_entry: &mut dyn FnMut(DirEntry<'_>) -> Result<usize>, ) -> Result<()>
Read a directory. Read more
Source§fn readdirplus(
&self,
ctx: &Context,
inode: u64,
handle: u64,
size: u32,
offset: u64,
add_entry: &mut dyn FnMut(DirEntry<'_>, Entry) -> Result<usize>,
) -> Result<()>
fn readdirplus( &self, ctx: &Context, inode: u64, handle: u64, size: u32, offset: u64, add_entry: &mut dyn FnMut(DirEntry<'_>, Entry) -> Result<usize>, ) -> Result<()>
Read a directory with entry attributes. Read more
Source§fn releasedir(
&self,
ctx: &Context,
inode: u64,
flags: u32,
handle: u64,
) -> Result<()>
fn releasedir( &self, ctx: &Context, inode: u64, flags: u32, handle: u64, ) -> Result<()>
Release an open directory. Read more
Source§fn access(&self, ctx: &Context, inode: u64, mask: u32) -> Result<()>
fn access(&self, ctx: &Context, inode: u64, mask: u32) -> Result<()>
Check file access permissions. Read more
§fn symlink(
&self,
ctx: &Context,
linkname: &CStr,
parent: Self::Inode,
name: &CStr,
) -> Result<Entry, Error>
fn symlink( &self, ctx: &Context, linkname: &CStr, parent: Self::Inode, name: &CStr, ) -> Result<Entry, Error>
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>
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 mkdir(
&self,
ctx: &Context,
parent: Self::Inode,
name: &CStr,
mode: u32,
umask: u32,
) -> Result<Entry, Error>
fn mkdir( &self, ctx: &Context, parent: Self::Inode, name: &CStr, mode: u32, umask: u32, ) -> Result<Entry, Error>
Create a directory. Read more
§fn rename(
&self,
ctx: &Context,
olddir: Self::Inode,
oldname: &CStr,
newdir: Self::Inode,
newname: &CStr,
flags: u32,
) -> Result<(), Error>
fn rename( &self, ctx: &Context, olddir: Self::Inode, oldname: &CStr, newdir: Self::Inode, newname: &CStr, flags: u32, ) -> Result<(), Error>
Rename a file / directory. Read more
§fn link(
&self,
ctx: &Context,
inode: Self::Inode,
newparent: Self::Inode,
newname: &CStr,
) -> Result<Entry, Error>
fn link( &self, ctx: &Context, inode: Self::Inode, newparent: Self::Inode, newname: &CStr, ) -> Result<Entry, Error>
Create a hard link. Read more
§fn create(
&self,
ctx: &Context,
parent: Self::Inode,
name: &CStr,
args: CreateIn,
) -> Result<(Entry, Option<Self::Handle>, OpenOptions, Option<u32>), Error>
fn create( &self, ctx: &Context, parent: Self::Inode, name: &CStr, args: CreateIn, ) -> Result<(Entry, Option<Self::Handle>, OpenOptions, Option<u32>), Error>
Create and open a file. 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 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 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
Source§impl<L> Layer for ZeroOpenLayer<L>
impl<L> Layer for ZeroOpenLayer<L>
Source§fn root_inode(&self) -> u64
fn root_inode(&self) -> u64
Return the root inode number
§fn create_whiteout(
&self,
ctx: &Context,
parent: Self::Inode,
name: &CStr,
) -> Result<Entry, Error>
fn create_whiteout( &self, ctx: &Context, parent: Self::Inode, name: &CStr, ) -> Result<Entry, Error>
Create whiteout file with name . Read more
§fn delete_whiteout(
&self,
ctx: &Context,
parent: Self::Inode,
name: &CStr,
) -> Result<(), Error>
fn delete_whiteout( &self, ctx: &Context, parent: Self::Inode, name: &CStr, ) -> Result<(), Error>
Delete whiteout file with name .
§fn is_whiteout(&self, ctx: &Context, inode: Self::Inode) -> Result<bool, Error>
fn is_whiteout(&self, ctx: &Context, inode: Self::Inode) -> Result<bool, Error>
Check if the Inode is a whiteout file
§fn set_opaque(&self, ctx: &Context, inode: Self::Inode) -> Result<(), Error>
fn set_opaque(&self, ctx: &Context, inode: Self::Inode) -> Result<(), Error>
Set the directory to opaque.
Auto Trait Implementations§
impl<L> Freeze for ZeroOpenLayer<L>where
L: Freeze,
impl<L> RefUnwindSafe for ZeroOpenLayer<L>where
L: RefUnwindSafe,
impl<L> Send for ZeroOpenLayer<L>
impl<L> Sync for ZeroOpenLayer<L>
impl<L> Unpin for ZeroOpenLayer<L>where
L: Unpin,
impl<L> UnsafeUnpin for ZeroOpenLayer<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for ZeroOpenLayer<L>where
L: UnwindSafe,
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