Step 5-1-1: No longer need to add unmounting for default mount points

This commit is contained in:
ShirkNeko
2025-11-20 19:53:18 +08:00
parent dd969eac22
commit ff3071ca08
4 changed files with 26 additions and 133 deletions

View File

@@ -33,44 +33,12 @@ static struct umount_entry *find_entry_locked(const char *path)
return NULL;
}
static int init_default_entries(void)
{
int ret;
const struct {
const char *path;
int flags;
} defaults[] = {
{ "/odm", 0 },
{ "/system", 0 },
{ "/vendor", 0 },
{ "/product", 0 },
{ "/system_ext", 0 },
{ "/data/adb/modules", MNT_DETACH },
{ "/debug_ramdisk", MNT_DETACH },
};
for (int i = 0; i < ARRAY_SIZE(defaults); i++) {
ret = ksu_umount_manager_add(defaults[i].path,
defaults[i].flags,
true); // is_default = true
if (ret) {
pr_err("Failed to add default entry: %s, ret=%d\n",
defaults[i].path, ret);
return ret;
}
}
pr_info("Initialized %zu default umount entries\n", ARRAY_SIZE(defaults));
return 0;
}
int ksu_umount_manager_init(void)
{
INIT_LIST_HEAD(&g_umount_mgr.entry_list);
spin_lock_init(&g_umount_mgr.lock);
return init_default_entries();
return 0;
}
void ksu_umount_manager_exit(void)