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
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
use std::convert::{TryFrom, TryInto};
use std::path::PathBuf;
use crate::fs_service::{FsBackendMountCmd, FsBackendUmountCmd};
use crate::Result;
#[derive(thiserror::Error, Debug)]
pub enum UpgradeMgrError {}
#[derive(PartialEq, Eq)]
pub enum FailoverPolicy {
Flush,
Resend,
}
impl TryFrom<&str> for FailoverPolicy {
type Error = std::io::Error;
fn try_from(p: &str) -> std::result::Result<Self, Self::Error> {
match p {
"flush" => Ok(FailoverPolicy::Flush),
"resend" => Ok(FailoverPolicy::Resend),
x => Err(einval!(format!("invalid FUSE fail-over mode {}", x))),
}
}
}
impl TryFrom<&String> for FailoverPolicy {
type Error = std::io::Error;
fn try_from(p: &String) -> std::result::Result<Self, Self::Error> {
p.as_str().try_into()
}
}
pub struct UpgradeManager {}
impl UpgradeManager {
pub fn new(_: PathBuf) -> Self {
UpgradeManager {}
}
pub fn add_mounts_state(&mut self, _cmd: FsBackendMountCmd, _vfs_index: u8) -> Result<()> {
Ok(())
}
pub fn update_mounts_state(&mut self, _cmd: FsBackendMountCmd) -> Result<()> {
Ok(())
}
pub fn remove_mounts_state(&mut self, _cmd: FsBackendUmountCmd) -> Result<()> {
Ok(())
}
pub fn disable_upgrade(&mut self) {}
}
pub mod fusedev_upgrade {
use super::*;
use crate::fusedev::FusedevDaemon;
pub fn save(_daemon: &FusedevDaemon) -> Result<()> {
Ok(())
}
pub fn restore(_daemon: &FusedevDaemon) -> Result<()> {
Ok(())
}
}