pub struct MemoryRegularNode { /* private fields */ }Implementations§
Source§impl MemoryRegularNode
impl MemoryRegularNode
Sourcepub fn from_memory(memory: Arc<MemoryObject>) -> Self
pub fn from_memory(memory: Arc<MemoryObject>) -> Self
Create a new file node based on an existing VMO.
Attempts to open the file for writing will fail unless [memory] has both
the WRITE and RESIZE rights.
Trait Implementations§
Source§impl FsNodeOps for MemoryRegularNode
impl FsNodeOps for MemoryRegularNode
Source§fn lookup(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_name: &FsStr,
) -> Result<FsNodeHandle, Errno>
fn lookup( &self, _node: &FsNode, _current_task: &CurrentTask, _name: &FsStr, ) -> Result<FsNodeHandle, Errno>
Find an existing child node and populate the child parameter. Return the node. Read more
Source§fn mknod(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_name: &FsStr,
_mode: FileMode,
_dev: DeviceId,
_owner: FsCred,
) -> Result<FsNodeHandle, Errno>
fn mknod( &self, _node: &FsNode, _current_task: &CurrentTask, _name: &FsStr, _mode: FileMode, _dev: DeviceId, _owner: FsCred, ) -> Result<FsNodeHandle, Errno>
Create and return the given child node. Read more
Source§fn mkdir(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_name: &FsStr,
_mode: FileMode,
_owner: FsCred,
) -> Result<FsNodeHandle, Errno>
fn mkdir( &self, _node: &FsNode, _current_task: &CurrentTask, _name: &FsStr, _mode: FileMode, _owner: FsCred, ) -> Result<FsNodeHandle, Errno>
Create and return the given child node as a subdirectory.
Source§fn create_symlink(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_name: &FsStr,
_target: &FsStr,
_owner: FsCred,
) -> Result<FsNodeHandle, Errno>
fn create_symlink( &self, _node: &FsNode, _current_task: &CurrentTask, _name: &FsStr, _target: &FsStr, _owner: FsCred, ) -> Result<FsNodeHandle, Errno>
Creates a symlink with the given
target path.Source§fn unlink(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_name: &FsStr,
_child: &FsNodeHandle,
) -> Result<(), Errno>
fn unlink( &self, _node: &FsNode, _current_task: &CurrentTask, _name: &FsStr, _child: &FsNodeHandle, ) -> Result<(), Errno>
Remove the child with the given name, if the child exists. Read more
Source§fn get_xattr(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
name: &FsStr,
_size: usize,
) -> Result<ValueOrSize<FsString>, Errno>
fn get_xattr( &self, _node: &FsNode, _current_task: &CurrentTask, name: &FsStr, _size: usize, ) -> Result<ValueOrSize<FsString>, Errno>
Get an extended attribute on the node. Read more
Source§fn set_xattr(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
name: &FsStr,
value: &FsStr,
op: XattrOp,
) -> Result<(), Errno>
fn set_xattr( &self, _node: &FsNode, _current_task: &CurrentTask, name: &FsStr, value: &FsStr, op: XattrOp, ) -> Result<(), Errno>
Set an extended attribute on the node.
fn remove_xattr( &self, _node: &FsNode, _current_task: &CurrentTask, name: &FsStr, ) -> Result<(), Errno>
Source§fn list_xattrs(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_size: usize,
) -> Result<ValueOrSize<Vec<FsString>>, Errno>
fn list_xattrs( &self, _node: &FsNode, _current_task: &CurrentTask, _size: usize, ) -> Result<ValueOrSize<Vec<FsString>>, Errno>
An implementation can systematically return a value. Otherwise, if
max_size is 0, it can
instead return the size of the 0 separated string needed to represent the value, and can
return an ERANGE error if max_size is not 0, and lesser than the required size.Source§fn initial_info(&self, info: &mut FsNodeInfo)
fn initial_info(&self, info: &mut FsNodeInfo)
Update the supplied info with initial state (e.g. size) for the node. Read more
Source§fn create_file_ops(
&self,
node: &FsNode,
_current_task: &CurrentTask,
flags: OpenFlags,
) -> Result<Box<dyn FileOps>, Errno>
fn create_file_ops( &self, node: &FsNode, _current_task: &CurrentTask, flags: OpenFlags, ) -> Result<Box<dyn FileOps>, Errno>
Build the
FileOps for the file associated to this node. Read moreSource§fn truncate(
&self,
_guard: &AppendLockWriteGuard<'_>,
node: &FsNode,
_current_task: &CurrentTask,
length: u64,
) -> Result<(), Errno>
fn truncate( &self, _guard: &AppendLockWriteGuard<'_>, node: &FsNode, _current_task: &CurrentTask, length: u64, ) -> Result<(), Errno>
Change the length of the file.
Source§fn allocate(
&self,
_guard: &AppendLockWriteGuard<'_>,
node: &FsNode,
_current_task: &CurrentTask,
mode: FallocMode,
offset: u64,
length: u64,
) -> Result<(), Errno>
fn allocate( &self, _guard: &AppendLockWriteGuard<'_>, node: &FsNode, _current_task: &CurrentTask, mode: FallocMode, offset: u64, length: u64, ) -> Result<(), Errno>
Manipulate allocated disk space for the file.
Source§fn check_access(
&self,
node: &FsNode,
current_task: &CurrentTask,
access: PermissionFlags,
info: &DynamicLockDepRwLock<FsNodeInfo>,
reason: CheckAccessReason,
audit_context: Auditable<'_>,
) -> Result<(), Errno>
fn check_access( &self, node: &FsNode, current_task: &CurrentTask, access: PermissionFlags, info: &DynamicLockDepRwLock<FsNodeInfo>, reason: CheckAccessReason, audit_context: Auditable<'_>, ) -> Result<(), Errno>
Delegate the access check to the node.
Source§fn create_dir_entry_ops(&self) -> Box<dyn DirEntryOps>
fn create_dir_entry_ops(&self) -> Box<dyn DirEntryOps>
Build the
DirEntryOps for a new [DirEntry] that will be associated
to this node.Source§fn has_lookup_pipelined(&self) -> bool
fn has_lookup_pipelined(&self) -> bool
Returns whether this node supports pipelined lookups.
Source§fn lookup_pipelined(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_names: &[&FsStr],
) -> LookupVec<Result<FsNodeHandle, Errno>>
fn lookup_pipelined( &self, _node: &FsNode, _current_task: &CurrentTask, _names: &[&FsStr], ) -> LookupVec<Result<FsNodeHandle, Errno>>
Find multiple children nodes in sequence. Read more
Source§fn create_tmpfile(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_mode: FileMode,
_owner: FsCred,
) -> Result<FsNodeHandle, Errno>
fn create_tmpfile( &self, _node: &FsNode, _current_task: &CurrentTask, _mode: FileMode, _owner: FsCred, ) -> Result<FsNodeHandle, Errno>
Creates an anonymous file. Read more
Source§fn readlink(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
) -> Result<SymlinkTarget, Errno>
fn readlink( &self, _node: &FsNode, _current_task: &CurrentTask, ) -> Result<SymlinkTarget, Errno>
Reads the symlink from this node.
Source§fn link(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_name: &FsStr,
_child: &FsNodeHandle,
) -> Result<(), Errno>
fn link( &self, _node: &FsNode, _current_task: &CurrentTask, _name: &FsStr, _child: &FsNodeHandle, ) -> Result<(), Errno>
Create a hard link with the given name to the given child.
Source§fn append_lock_read<'a>(
&'a self,
node: &'a FsNode,
current_task: &CurrentTask,
) -> Result<AppendLockGuard<'a>, Errno>
fn append_lock_read<'a>( &'a self, node: &'a FsNode, current_task: &CurrentTask, ) -> Result<AppendLockGuard<'a>, Errno>
Acquire the necessary append lock for the operations that depend on them.
Should be done before calling
allocate or truncate to avoid lock ordering issues.Source§fn append_lock_write<'a>(
&'a self,
node: &'a FsNode,
current_task: &CurrentTask,
) -> Result<AppendLockWriteGuard<'a>, Errno>
fn append_lock_write<'a>( &'a self, node: &'a FsNode, current_task: &CurrentTask, ) -> Result<AppendLockWriteGuard<'a>, Errno>
Acquire the necessary append lock for operations that need exclusive access (e.g., write append).
Source§fn fetch_and_refresh_info<'a>(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
info: &'a DynamicLockDepRwLock<FsNodeInfo>,
) -> Result<LockDepReadGuard<'a, FsNodeInfo>, Errno>
fn fetch_and_refresh_info<'a>( &self, _node: &FsNode, _current_task: &CurrentTask, info: &'a DynamicLockDepRwLock<FsNodeInfo>, ) -> Result<LockDepReadGuard<'a, FsNodeInfo>, Errno>
Update node.info as needed. Read more
Source§fn sync(&self, _node: &FsNode, _current_task: &CurrentTask) -> Result<(), Errno>
fn sync(&self, _node: &FsNode, _current_task: &CurrentTask) -> Result<(), Errno>
Syncs cached data to persistent storage.
Source§fn update_attributes(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_info: &FsNodeInfo,
_has: zxio_node_attr_has_t,
) -> Result<(), Errno>
fn update_attributes( &self, _node: &FsNode, _current_task: &CurrentTask, _info: &FsNodeInfo, _has: zxio_node_attr_has_t, ) -> Result<(), Errno>
Update node attributes persistently.
Source§fn forget(
self: Box<Self>,
_current_task: &CurrentTask,
_info: FsNodeInfo,
) -> Result<(), Errno>
fn forget( self: Box<Self>, _current_task: &CurrentTask, _info: FsNodeInfo, ) -> Result<(), Errno>
Called when the FsNode is freed by the Kernel.
Source§fn enable_fsverity(
&self,
_node: &FsNode,
_current_task: &CurrentTask,
_descriptor: &fsverity_descriptor,
) -> Result<(), Errno>
fn enable_fsverity( &self, _node: &FsNode, _current_task: &CurrentTask, _descriptor: &fsverity_descriptor, ) -> Result<(), Errno>
Marks that FS-Verity is being built. Writes fsverity descriptor and merkle tree, the latter
computed by the filesystem.
This should ensure there are no writable file handles. Returns EEXIST if the file was
already fsverity-enabled. Returns EBUSY if this ioctl was already running on this file.
Source§fn get_fsverity_descriptor(
&self,
_log_blocksize: u8,
) -> Result<fsverity_descriptor, Errno>
fn get_fsverity_descriptor( &self, _log_blocksize: u8, ) -> Result<fsverity_descriptor, Errno>
Read fsverity descriptor, if the node is fsverity-enabled. Else returns ENODATA.
Auto Trait Implementations§
impl !Freeze for MemoryRegularNode
impl !RefUnwindSafe for MemoryRegularNode
impl Send for MemoryRegularNode
impl Sync for MemoryRegularNode
impl Unpin for MemoryRegularNode
impl UnsafeUnpin for MemoryRegularNode
impl UnwindSafe for MemoryRegularNode
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [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