summaryrefslogtreecommitdiffstats
path: root/init/do_mounts_initrd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-21 11:12:08 +0200
committerChristoph Hellwig <hch@lst.de>2020-07-31 08:17:51 +0200
commitc60166f04283ffba7b88b45d824bbfb2bfccee24 (patch)
tree511e51f8ae0e91e50742bf73ccbe302e8b14a313 /init/do_mounts_initrd.c
parentinit: mark create_dev as __init (diff)
downloadlinux-c60166f04283ffba7b88b45d824bbfb2bfccee24.tar.xz
linux-c60166f04283ffba7b88b45d824bbfb2bfccee24.zip
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 'init/do_mounts_initrd.c')
-rw-r--r--init/do_mounts_initrd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index e08669187d63..1f9336209ad9 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -62,7 +62,7 @@ static int __init init_linuxrc(struct subprocess_info *info, struct cred *new)
console_on_rootfs();
/* move initrd over / and chdir/chroot in initrd root */
ksys_chdir("/root");
- do_mount(".", "/", NULL, MS_MOVE, NULL);
+ init_mount(".", "/", NULL, MS_MOVE, NULL);
ksys_chroot(".");
ksys_setsid();
return 0;
@@ -99,7 +99,7 @@ static void __init handle_initrd(void)
current->flags &= ~PF_FREEZER_SKIP;
/* move initrd to rootfs' /old */
- do_mount("..", ".", NULL, MS_MOVE, NULL);
+ init_mount("..", ".", NULL, MS_MOVE, NULL);
/* switch root and cwd back to / of rootfs */
ksys_chroot("..");
@@ -113,7 +113,7 @@ static void __init handle_initrd(void)
mount_root();
printk(KERN_NOTICE "Trying to move old root to /initrd ... ");
- error = do_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL);
+ error = init_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL);
if (!error)
printk("okay\n");
else {