kernel: By default, MNT_DETACH is used as the value for the mount point.
This commit is contained in:
@@ -109,6 +109,9 @@ int ksu_umount_manager_add(const char *path, bool check_mnt, int flags, bool is_
|
|||||||
unsigned long irqflags;
|
unsigned long irqflags;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (flags == -1)
|
||||||
|
flags = MNT_DETACH;
|
||||||
|
|
||||||
if (!path || strlen(path) == 0 || strlen(path) >= 256) {
|
if (!path || strlen(path) == 0 || strlen(path) >= 256) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ enum Umount {
|
|||||||
check_mnt: bool,
|
check_mnt: bool,
|
||||||
|
|
||||||
/// Umount flags (0 or 8 for MNT_DETACH)
|
/// Umount flags (0 or 8 for MNT_DETACH)
|
||||||
#[arg(long, default_value = "0")]
|
#[arg(long, default_value = "-1")]
|
||||||
flags: i32,
|
flags: i32,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,11 @@ impl UmountManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_entry(&mut self, path: &str, check_mnt: bool, flags: i32) -> Result<()> {
|
pub fn add_entry(&mut self, path: &str, check_mnt: bool, flags: i32) -> Result<()> {
|
||||||
let exists = self.defaults.iter().chain(&self.config.entries).any(|e| e.path == path);
|
let exists = self
|
||||||
|
.defaults
|
||||||
|
.iter()
|
||||||
|
.chain(&self.config.entries)
|
||||||
|
.any(|e| e.path == path);
|
||||||
if exists {
|
if exists {
|
||||||
return Err(anyhow!("Entry already exists: {}", path));
|
return Err(anyhow!("Entry already exists: {}", path));
|
||||||
}
|
}
|
||||||
@@ -166,7 +170,7 @@ impl UmountManager {
|
|||||||
UmountEntry {
|
UmountEntry {
|
||||||
path: "/data/adb/modules".to_string(),
|
path: "/data/adb/modules".to_string(),
|
||||||
check_mnt: false,
|
check_mnt: false,
|
||||||
flags: 0x00000002, // MNT_DETACH
|
flags: -1,
|
||||||
is_default: true,
|
is_default: true,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user