use fuser::{KernelConfig, MountOption, ReplyEmpty, ReplyOpen};
use std::fs::File;
pub const FS_IOC_BRANCH_CREATE: u32 = 0x4080_6200; pub const FS_IOC_BRANCH_COMMIT: u32 = 0x2000_6201; pub const FS_IOC_BRANCH_ABORT: u32 = 0x2000_6202;
pub fn get_mount_options() -> Vec<MountOption> {
vec![
MountOption::CUSTOM("noappledouble".to_string()),
MountOption::CUSTOM("volname=branchfs".to_string()),
MountOption::CUSTOM("defer_permissions".to_string()),
MountOption::CUSTOM("local".to_string()),
]
}
pub fn setup_capabilities(_config: &mut KernelConfig, passthrough_enabled: &mut bool) {
if *passthrough_enabled {
log::warn!("FUSE passthrough is only supported on Linux, disabling");
*passthrough_enabled = false;
}
}
pub fn handle_access(reply: ReplyEmpty) {
reply.ok();
}
pub fn check_rename_flags(_flags: u32) -> Result<(), i32> {
Ok(())
}
pub fn check_rename_noreplace(_flags: u32) -> bool {
false
}
pub fn ctl_file_size(_ino: u64) -> u64 {
0
}
pub struct PassthroughState {}
impl Default for PassthroughState {
fn default() -> Self {
Self {}
}
}
impl PassthroughState {
pub fn new() -> Self {
Self::default()
}
}
pub fn try_open_passthrough(_state: &mut PassthroughState, _file: File, reply: ReplyOpen) {
reply.opened(0, 0);
}
pub fn release_passthrough(_state: &mut PassthroughState, _fh: u64) {}