s32 check_fs_mounted(char *path_name)
{
struct path root_path;
struct path path;
s32 err;
err = kern_path("/", LOOKUP_FOLLOW, &root_path);
if (err)
return ERROR_PATH;
err = kern_path(path_name, LOOKUP_FOLLOW, &path);
if (err) {
err = ERROR_PATH;
goto check_fs_fail;
}
if (path.mnt->mnt_sb == root_path.mnt->mnt_sb) {
//-- not mounted
err = ERROR_PATH;
} else {
err = 0;
}
path_put(&path);
check_fs_fail:
path_put(&root_path);
return err;
}
驱动中检查文件系统有没有mount
最新推荐文章于 2022-12-22 17:48:04 发布