btrfs_diskformat/dev/
dev_extent.rs

1use crate::types::UuidBytes;
2use static_assertions::const_assert_eq;
3use zerocopy::little_endian::U64 as U64LE;
4use zerocopy_derive::*;
5
6/// Maps physical extents on an individual backing device to a chunk. This extent
7/// may be the only one for a particular chunk or one of several.
8///
9/// It is associated with the `DEV_ITEM` item. This structure is never used
10/// outside of this item.
11#[derive(Clone, Debug, Hash, IntoBytes, FromBytes, Unaligned, KnownLayout, Immutable)]
12#[repr(C, packed)]
13pub struct DevExtent {
14    /// The object ID of the chunk tree that owns this extent.
15    pub chunk_tree: U64LE,
16
17    /// The object ID of the chunk item that references this extent.
18    pub chunk_objectid: U64LE,
19
20    /// The offset of the chunk item that references this extent.
21    pub chunk_offset: U64LE,
22
23    /// The length of this extent, in bytes.
24    pub length: U64LE,
25
26    /// The UUID of the chunk tree that owns this extent.
27    pub chunk_tree_uuid: UuidBytes,
28}
29const_assert_eq!(core::mem::size_of::<DevExtent>(), 48);