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