/* * Copyright (c) 2021, Luca Fulchir * * 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 . */ use super::super::errors; #[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), RuntimeFeatures(Vec), Force, Custom(String), } #[derive(::serde::Deserialize, Clone)] #[serde(deny_unknown_fields)] pub struct BTRFS { id: String, label: Option, UUID: Option<::uuid::Uuid>, options: Vec, } impl super::FSTrait for BTRFS { fn id(&self) -> &str { self.id.as_str() } fn create(&self) -> Result<(), ::std::io::Error> { Ok(()) } }