btrfs_no_std/extent/shared_data_ref.rs
1use {
2 byteorder::LE,
3 static_assertions::const_assert_eq,
4 zerocopy::{AsBytes, FromBytes, Unaligned, U32},
5};
6
7/// This structure contains the reference count for a shared back reference for a file data extent.
8///
9/// This immediately follows an [`ExtentInlineRef`] of type [`SharedDataRef`] inside an extent item.
10///
11/// [`ExtentInlineRef`]: crate::ExtentInlineRef
12/// [`SharedDataRef`]: crate::ExtentInlineRefType::SharedDataRef
13#[derive(Copy, Clone, Debug, AsBytes, FromBytes, Unaligned)]
14#[repr(C, packed)]
15pub struct SharedDataRef {
16 /// The reference count.
17 pub count: U32<LE>,
18}
19const_assert_eq!(core::mem::size_of::<SharedDataRef>(), 4);