1 // SPDX-License-Identifier: GPL-2.0
3 * Routines that mimic syscalls, but don't use the user address space or file
4 * descriptors. Only for init/ and related early init code.
6 #include <linux/init.h>
7 #include <linux/mount.h>
8 #include <linux/namei.h>
10 #include <linux/init_syscalls.h>
13 int __init init_mount(const char *dev_name, const char *dir_name,
14 const char *type_page, unsigned long flags, void *data_page)
19 ret = kern_path(dir_name, LOOKUP_FOLLOW, &path);
22 ret = path_mount(dev_name, &path, type_page, flags, data_page);
27 int __init init_umount(const char *name, int flags)
29 int lookup_flags = LOOKUP_MOUNTPOINT;
33 if (!(flags & UMOUNT_NOFOLLOW))
34 lookup_flags |= LOOKUP_FOLLOW;
35 ret = kern_path(name, lookup_flags, &path);
38 return path_umount(&path, flags);
41 int __init init_unlink(const char *pathname)
43 return do_unlinkat(AT_FDCWD, getname_kernel(pathname));