Newer
Older
/*
* Copyright (c) 2021, Luca Fulchir <luker@fenrirproject.org>
*
* This file is part of dfim.
*
* dfim is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* dfim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with dfim. If not, see <https://www.gnu.org/licenses/>.
*/
use super::super::errors;
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum Checksum {
Crc32c,
Xxhash,
Sha256,
Blake2,
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum Profile {
Raid0,
Raid1,
Raid1c3,
Raid1c4,
Raid5,
Raid6,
Raid10,
Single,
Dup,
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum HasFeature {
Enabled(Feature),
Disable(Feature),
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum Feature {
MixedBg,
Extrer,
Raid56,
SkinnyMetadata,
NoHole,
Raid1c34,
Zoned,
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum HasRuntimeFeature {
Enabled(Feature),
Disable(Feature),
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum RuntimeFeatures {
Quota,
FreeSpaceTree,
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub enum Options {
ByteCount(u64),
CheckSum(Checksum),
Data(Profile),
Metadata(Profile),
Mixed,
NodeSize(u16),
SectorSize(u64),
NoDiscard,
RootDir(::std::path::PathBuf),
Shrink,
Features(Vec<HasFeature>),
RuntimeFeatures(Vec<HasRuntimeFeature>),
Force,
Custom(String),
}
#[derive(::serde::Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct BTRFS {
id: String,
label: Option<String>,
UUID: Option<::uuid::Uuid>,
fn id(&self) -> &str {
self.id.as_str()
}