btrfs_no_std/core/
root_ref.rs

1use {
2    byteorder::LE,
3    static_assertions::const_assert_eq,
4    zerocopy::{AsBytes, FromBytes, Unaligned, U16, U64},
5};
6
7/// References a subvolume filesystem tree root. This is used for both forward and
8/// backward root references.
9///
10/// The name of the tree is stored after the end of the struct.
11#[derive(Copy, Clone, Debug, AsBytes, FromBytes, Unaligned)]
12#[repr(C, packed)]
13pub struct RootRef {
14    /// The subtree ID.
15    pub dirid: U64<LE>,
16
17    /// The directory sequence number of the subtree entry.
18    pub sequence: U64<LE>,
19
20    /// The length of the subtree name, stored after this field.
21    pub name_len: U16<LE>,
22}
23const_assert_eq!(core::mem::size_of::<RootRef>(), 18);