summaryrefslogtreecommitdiff
path: root/drivers/base/devtmpfs.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-21 12:12:08 +0300
committerChristoph Hellwig <hch@lst.de>2020-07-31 09:17:51 +0300
commitc60166f04283ffba7b88b45d824bbfb2bfccee24 (patch)
tree511e51f8ae0e91e50742bf73ccbe302e8b14a313 /drivers/base/devtmpfs.c
parent09cbcec07b578c04ab4ab0e31940c20126f79c4b (diff)
downloadlinux-c60166f04283ffba7b88b45d824bbfb2bfccee24.tar.xz
init: add an init_mount helper
Like do_mount, but takes a kernel pointer for the destination path. Switch over the mounts in the init code and devtmpfs to it, 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>
Diffstat (limited to 'drivers/base/devtmpfs.c')
-rw-r--r--drivers/base/devtmpfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index d697634bc0d4..32af6cb987b4 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -25,6 +25,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/kthread.h>
+#include <linux/init_syscalls.h>
#include <uapi/linux/mount.h>
#include "base.h"
@@ -359,7 +360,7 @@ int __init devtmpfs_mount(void)
if (!thread)
return 0;
- err = do_mount("devtmpfs", "dev", "devtmpfs", MS_SILENT, NULL);
+ err = init_mount("devtmpfs", "dev", "devtmpfs", MS_SILENT, NULL);
if (err)
printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
else
@@ -408,7 +409,7 @@ static int __init devtmpfs_setup(void *p)
err = ksys_unshare(CLONE_NEWNS);
if (err)
goto out;
- err = do_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, NULL);
+ err = init_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, NULL);
if (err)
goto out;
ksys_chdir("/.."); /* will traverse into overmounted root */