zfs/zfs.rs
1use std::result;
2
3/// The error type used throughout ZFS
4#[derive(Copy, Clone, Debug, PartialEq)]
5pub enum Error {
6 NoEntity,
7 Invalid,
8}
9
10/// The Result type used throughout ZFS
11pub type Result<T> = result::Result<T, Error>;
12
13/// The following states are written to disk as part of the normal
14/// SPA lifecycle: Active, Exported, Destroyed, Spare, L2Cache. The remaining
15/// states are software abstractions used at various levels to communicate
16/// pool state.
17#[derive(Copy, Clone, PartialEq)]
18pub enum PoolState {
19 Active = 0, // In active use
20 Exported, // Explicitly exported
21 Destroyed, // Explicitly destroyed
22 Spare, // Reserved for hot spare use
23 L2Cache, // Level 2 ARC device
24 Uninitialized, // Internal spa_t state
25 Unavailable, // Internal libzfs state
26 PotentiallyActive, // Internal libzfs state
27}
28
29/// Internal SPA load state. Used by FMA diagnosis engine.
30#[derive(Copy, Clone, PartialEq)]
31pub enum SpaLoadState {
32 None, // no load in progress
33 Open, // normal open
34 Import, // import in progress
35 TryImport, // tryimport in progress
36 Recover, // recovery requested
37 Error, // load failed
38}