VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christoph Hellwig <hch@lst.de> 2020-07-21 11:12:08 +0200 committer: Christoph Hellwig <hch@lst.de> 2020-07-31 08:17:51 +0200 commit: c60166f04283ffba7b88b45d824bbfb2bfccee24 parent: 09cbcec07b578c04ab4ab0e31940c20126f79c4b
Commit Summary:
init: add an init_mount helper
Diffstat:
1 file changed, 23 insertions, 0 deletions
diff --git a/fs/init.c b/fs/init.c
new file mode 100644
index 000000000000..c6eb724e1c7b
--- /dev/null
+++ b/fs/init.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Routines that mimic syscalls, but don't use the user address space or file
+ * descriptors.  Only for init/ and related early init code.
+ */
+#include <linux/init.h>
+#include <linux/mount.h>
+#include <linux/namei.h>
+#include <linux/fs.h>
+#include <linux/init_syscalls.h>
+#include "internal.h"
+
+int __init init_mount(const char *dev_name, const char *dir_name,
+		const char *type_page, unsigned long flags, void *data_page)
+{
+	struct path path;
+	int ret;
+
+	ret = kern_path(dir_name, LOOKUP_FOLLOW, &path);
+	if (ret)
+		return ret;
+	ret = path_mount(dev_name, &path, type_page, flags, data_page);
+	path_put(&path);
+	return ret;
+}