mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
init: add an init_umount helper
Like ksys_umount, but takes a kernel pointer for the destination path. Switch over the umount in the init code, which just happen to work due to the implicit set_fs(KERNEL_DS) during early init right now. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
c60166f042
commit
09267defa3
6 changed files with 19 additions and 4 deletions
14
fs/init.c
14
fs/init.c
|
@ -23,3 +23,17 @@ int __init init_mount(const char *dev_name, const char *dir_name,
|
|||
path_put(&path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __init init_umount(const char *name, int flags)
|
||||
{
|
||||
int lookup_flags = LOOKUP_MOUNTPOINT;
|
||||
struct path path;
|
||||
int ret;
|
||||
|
||||
if (!(flags & UMOUNT_NOFOLLOW))
|
||||
lookup_flags |= LOOKUP_FOLLOW;
|
||||
ret = kern_path(name, lookup_flags, &path);
|
||||
if (ret)
|
||||
return ret;
|
||||
return path_umount(&path, flags);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue