btrfs_no_std/extent/extent_data_ref.rs
1use {
2 byteorder::LE,
3 static_assertions::const_assert_eq,
4 zerocopy::{AsBytes, FromBytes, Unaligned, U32, U64},
5};
6
7/// Contains an indirect back reference for a file data extent.
8///
9/// Immediately follows an [`ExtentInlineRef`]. See that documentation for more details.
10///
11/// [`ExtentInlineRef`]: crate::ExtentInlineRef
12#[derive(Copy, Clone, Debug, AsBytes, FromBytes, Unaligned)]
13#[repr(C, packed)]
14pub struct ExtentDataRef {
15 /// The object ID for the file tree that references this extent.
16 pub root: U64<LE>,
17
18 /// The object ID of the inode that contains the extent data that references this extent.
19 pub objectid: U64<LE>,
20
21 /// The offset within the file that corresponds to this extent.
22 pub offset: U64<LE>,
23
24 /// The reference count being held.
25 pub count: U32<LE>,
26}
27const_assert_eq!(core::mem::size_of::<ExtentDataRef>(), 28);