btrfs_diskformat/extent/
shared_data_ref.rs

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