blob: c6eb724e1c7b22e91dbd254b3c6b88db75f65210 [file] [log] [blame]
Christoph Hellwigc60166f2020-07-21 11:12:08 +02001// SPDX-License-Identifier: GPL-2.0
2/*
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.
5 */
6#include <linux/init.h>
7#include <linux/mount.h>
8#include <linux/namei.h>
9#include <linux/fs.h>
10#include <linux/init_syscalls.h>
11#include "internal.h"
12
13int __init init_mount(const char *dev_name, const char *dir_name,
14 const char *type_page, unsigned long flags, void *data_page)
15{
16 struct path path;
17 int ret;
18
19 ret = kern_path(dir_name, LOOKUP_FOLLOW, &path);
20 if (ret)
21 return ret;
22 ret = path_mount(dev_name, &path, type_page, flags, data_page);
23 path_put(&path);
24 return ret;
25}