kernel: Add nuke_ext4_sysfs interface

This commit is contained in:
weishu
2025-11-17 13:24:30 +00:00
committed by ShirkNeko
parent f1909411c0
commit bc7266111c
4 changed files with 45 additions and 7 deletions

View File

@@ -103,14 +103,14 @@ void on_post_fs_data(void)
}
extern void ext4_unregister_sysfs(struct super_block *sb);
static void nuke_ext4_sysfs(void)
int nuke_ext4_sysfs(const char* mnt)
{
#ifdef CONFIG_EXT4_FS
struct path path;
int err = kern_path("/data/adb/modules", 0, &path);
int err = kern_path(mnt, 0, &path);
if (err) {
pr_err("nuke path err: %d\n", err);
return;
return err;
}
struct super_block *sb = path.dentry->d_inode->i_sb;
@@ -118,18 +118,19 @@ static void nuke_ext4_sysfs(void)
if (strcmp(name, "ext4") != 0) {
pr_info("nuke but module aren't mounted\n");
path_put(&path);
return;
return -EINVAL;
}
ext4_unregister_sysfs(sb);
path_put(&path);
return 0;
#endif
}
void on_module_mounted(void){
pr_info("on_module_mounted!\n");
ksu_module_mounted = true;
nuke_ext4_sysfs();
}
void on_boot_completed(void){