1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use {
bitflags::bitflags,
byteorder::LE,
static_assertions::const_assert_eq,
zerocopy::{AsBytes, FromBytes, Unaligned, U64},
};
#[derive(Copy, Clone, Debug, AsBytes, FromBytes, Unaligned)]
#[repr(C, packed)]
pub struct BlockGroupItem {
pub used: U64<LE>,
pub chunk_objectid: U64<LE>,
pub flags: U64<LE>,
}
const_assert_eq!(std::mem::size_of::<BlockGroupItem>(), 24);
bitflags! {
pub struct AllocationType: u64 {
const DATA = 0x1;
const SYSTEM = 0x2;
const METADATA = 0x4;
}
}
bitflags! {
pub struct ReplicationPolicy: u64 {
const RAID0 = 0x8;
const RAID1 = 0x10;
const DUP = 0x20;
const RAID10 = 0x40;
const RAID5 = 0x80;
const RAID6 = 0x100;
const RAID1C3 = 0x200;
const RAID1C4 = 0x400;
}
}