Struct Chunk

Source
#[repr(C, packed(1))]
pub struct Chunk { pub length: U64<LE>, pub owner: U64<LE>, pub stripe_len: U64<LE>, pub type: U64<LE>, pub io_align: U32<LE>, pub io_width: U32<LE>, pub sector_size: U32<LE>, pub num_stripes: U16<LE>, pub sub_stripes: U16<LE>, pub stripe: Stripe, }
Expand description

This structure contains the mapping from a virtualized usable byte range within the backing storage to a set of one or more stripes on individual backing devices. In addition to the mapping, hints on optimal I/O parameters for this chunk. It is associated with CHUNK_ITEM.

Although the structure definition only contains one stripe member, CHUNK_ITEM contain as many struct Stripe structures as specified in the num_stripes and sub_stripes fields.

Fields§

§length: U64<LE>

The size of this chunk, in bytes.

§owner: U64<LE>

The object ID of the root referencing this chunk. This is always the ID of an extent root.

§stripe_len: U64<LE>

The replication stripe length.

§type: U64<LE>

Flags indicating allocation type and replication policy.

§io_align: U32<LE>

The optimal I/O alignment for this chunk.

§io_width: U32<LE>

The optimal I/O width for this chunk.

§sector_size: U32<LE>

The minimal I/O size for this chunk.

§num_stripes: U16<LE>

The number of replication stripes.

§sub_stripes: U16<LE>

The number of sub-stripes. This is only used for RAID-10.

§stripe: Stripe

The first of one or more stripes that map to device extents.

Trait Implementations§

Source§

impl AsBytes for Chunk

Source§

fn as_bytes(&self) -> &[u8]

Get the bytes of this value. Read more
Source§

fn as_bytes_mut(&mut self) -> &mut [u8]
where Self: FromBytes,

Get the bytes of this value mutably. Read more
Source§

impl Clone for Chunk

Source§

fn clone(&self) -> Chunk

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Chunk

Source§

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

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

impl Copy for Chunk

Source§

impl FromBytes for Chunk

Source§

impl Unaligned for Chunk

Auto Trait Implementations§

§

impl Freeze for Chunk

§

impl RefUnwindSafe for Chunk

§

impl Send for Chunk

§

impl Sync for Chunk

§

impl Unpin for Chunk

§

impl UnwindSafe for Chunk

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> 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, 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.