Skip to main content

InodeRaw

Struct InodeRaw 

Source
#[repr(C, align(8))]
pub struct InodeRaw {
Show 18 fields pub i_ino: u64, pub i_atime: u64, pub i_ctime: u64, pub i_mtime: u64, pub i_atime_nsec: u32, pub i_ctime_nsec: u32, pub i_mtime_nsec: u32, pub i_meta_config: u32, pub i_uid: u32, pub i_gid: u32, pub i_mode: u32, pub i_flags: u32, pub i_nlink: u64, pub i_size: u64, pub i_blocks: u64, pub i_last_seq: u64, pub i_last_cno: u64, pub i_bmap: BMapRawType,
}

Fields§

§i_ino: u64§i_atime: u64§i_ctime: u64§i_mtime: u64§i_atime_nsec: u32§i_ctime_nsec: u32§i_mtime_nsec: u32§i_meta_config: u32§i_uid: u32§i_gid: u32§i_mode: u32§i_flags: u32§i_nlink: u64§i_size: u64§i_blocks: u64§i_last_seq: u64§i_last_cno: u64§i_bmap: BMapRawType

Implementations§

Source§

impl InodeRaw

Source

pub const FLAG_INLINE: u32 = 0x1

i_flags bit marking a fully-inlined small file: its bytes live in this inode’s tail region (i_blocks..i_bmap) instead of in data blocks, and the file has NO separate FILE/<uuid> object. i_size is the length.

Source

pub const FLAG_KEEP_OPEN: u32 = 0x2

i_flags bit marking a file that opts in to cross-mount open-but-unlinked semantics: while any mount holds it open (tracked by an S3 open-lease), an unlink from another mount silly-renames it instead of tombstoning, so its storage survives until the last close. Set via the user.hyperfs.keep_open xattr; off by default (no extra coordination cost). Independent of FLAG_INLINE.

Source

pub fn as_mut_u8_slice(&mut self) -> &mut [u8] ⓘ

Source

pub fn as_u8_slice(&self) -> &[u8] ⓘ

Source

pub fn from_u8_slice(buf: &[u8]) -> Self

Source

pub fn is_keep_open(&self) -> bool

True if this inode opts in to cross-mount open-but-unlinked (see [FLAG_KEEP_OPEN]).

Source

pub fn set_keep_open(&mut self, on: bool)

Set/clear [FLAG_KEEP_OPEN].

Source

pub const fn inline_offset() -> usize

Byte offset of the inline-data region within the raw inode (the start of the contiguous tail i_blocks, i_last_seq, i_last_cno, i_bmap).

Source

pub const fn inline_cap() -> usize

Maximum inline payload (the size of that tail region).

Source

pub fn is_inline(&self) -> bool

True if this inode is a fully-inlined small file.

Source

pub fn inline_data(&self) -> &[u8] ⓘ

The inlined bytes (i_size of them); empty if not inlined.

Source

pub fn set_inline(&mut self, data: &[u8])

Mark this inode inline and store data (must fit inline_cap()): sets the flag, i_size = data.len(), zeroes the tail region, copies in. Caller is responsible for there being no FILE/<uuid> object/segments.

Source

pub fn clear_inline(&mut self)

Clear the inline flag (e.g. when spilling to a real segmented file). Does not touch the tail region; the caller rebuilds the bmap.

Source

pub fn set_rdev(&mut self, rdev: u64)

Persist a char/block device node’s rdev. A device node has no data segments, so the otherwise-unused i_last_cno slot holds it. Call after set_inline(&[]) (which zeroes the tail). Inode::to_stat reads it back for device-mode inodes.

Source

pub fn rdev(&self) -> u64

The persisted device rdev (see [set_rdev]); meaningful only for a char/block device-mode inode.

Trait Implementations§

Source§

impl Clone for InodeRaw

Source§

fn clone(&self) -> InodeRaw

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for InodeRaw

Source§

impl Debug for InodeRaw

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InodeRaw

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scope for T

Source§

fn with<F, R>(self, f: F) -> R
where Self: Sized, F: FnOnce(Self) -> R,

Scoped with ownership.
Source§

fn with_ref<F, R>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Scoped with reference.
Source§

fn with_mut<F, R>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Scoped with mutable reference.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> Value for T
where T: Send + Sync + 'static,

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