Struct btrfs_no_std::Chunk
source · [−]#[repr(C, packed)]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
sourceimpl AsBytes for Chunk
impl AsBytes for Chunk
sourcefn as_bytes_mut(&mut self) -> &mut [u8] where
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] where
Self: FromBytes,
Gets the bytes of this value mutably. Read more
sourcefn write_to<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self
to bytes
. Read more
sourcefn write_to_prefix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to_prefix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self
to the prefix of bytes
. Read more
sourcefn write_to_suffix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to_suffix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self
to the suffix of bytes
. Read more
sourceimpl FromBytes for Chunk
impl FromBytes for Chunk
sourcefn read_from<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self
from bytes
. Read more
sourcefn read_from_prefix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from_prefix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self
from the prefix of bytes
. Read more
sourcefn read_from_suffix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from_suffix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self
from the suffix of bytes
. Read more
sourcefn new_zeroed() -> Self
fn new_zeroed() -> Self
Creates an instance of Self
from zeroed bytes.
impl Copy for Chunk
impl Unaligned for Chunk
Auto Trait Implementations
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more