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
//! The multiple-mount protection block: the record a host keeps current while it has the
//! filesystem open, laid out as the ext4 documentation's "Multiple Mount Protection" page
//! gives it.
use crateget_u32;
/// The block's magic number, `"MMP"` (documented).
pub const MMP_MAGIC: u32 = 0x004D_4D50;
/// Where the block's checksum sits: the last word of its 1024-byte structure (documented). It
/// covers every byte before it, seeded as the filesystem's other metadata checksums are
/// (observed on the pinned `mke2fs`).
pub const MMP_CHECKSUM_OFFSET: usize = 0x3FC;
/// The sequence a filesystem no host has open records: the one the pinned `mke2fs` writes and
/// `e2fsck` checks without waiting (observed).
pub const MMP_SEQ_CLEAN: u32 = 0xFF4D_4D50;
/// The sequence a checker records while it runs: the pinned `e2fsck` refuses a filesystem
/// holding it, saying a check is running (observed).
pub const MMP_SEQ_FSCK: u32 = 0xE24D_4D50;
/// The largest sequence a host with the filesystem open records: the pinned `e2fsck` waits on
/// one at or below it to see whether it changes, and refuses one above it that is neither of
/// the two above (observed).
pub const MMP_SEQ_MAX: u32 = 0xE24D_4D4F;
/// The fields a reader holds the block to.
pub