Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.6 kB · 75 lines
Rust
at ci
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576use serde::{Deserialize, de};
#[derive(Debug, Deserialize, Clone, Copy)]#[serde(transparent)]pub struct Sectors(pub u64);
#[derive(Debug, Clone)]#[allow(dead_code)]pub struct DeviceRegion { pub start: Sectors, pub length: Sectors,}
impl<'de> Deserialize<'de> for DeviceRegion { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: de::Deserializer<'de>, { let (start, length) = <(Sectors, Sectors)>::deserialize(deserializer)?; Ok(DeviceRegion { start, length }) }}
#[derive(Debug, Deserialize, Clone)]#[allow(dead_code)]pub struct Alloc { pub parent: String, pub start: Sectors, pub length: Sectors,}
#[derive(Debug, Deserialize, Clone)]#[allow(dead_code)]pub struct Dev { pub uuid: String, pub integrity_meta_allocs: Vec<DeviceRegion>,}
#[derive(Debug, Deserialize, Clone)]#[allow(dead_code)]pub struct Blockdev { pub allocs: Vec<Vec<Alloc>>, pub devs: Vec<Dev>,}
#[derive(Debug, Deserialize, Clone)]#[allow(dead_code)]pub struct DataTier { pub blockdev: Blockdev,}
#[derive(Debug, Deserialize, Clone)]#[allow(dead_code)]pub struct Backstore { pub data_tier: DataTier,}
#[derive(Debug, Deserialize, Clone)]#[allow(dead_code)]pub struct FlexDevs { pub meta_dev: Vec<DeviceRegion>, pub thin_data_dev: Vec<DeviceRegion>, pub thin_meta_dev: Vec<DeviceRegion>, pub thin_meta_dev_spare: Vec<DeviceRegion>,}
#[derive(Debug, Deserialize, Clone)]pub struct PoolMetadata { pub backstore: Backstore, pub flex_devs: FlexDevs,}
impl PoolMetadata { pub const VERSION: u64 = 2;}