init: add an init_mkdir helper
Add a simple helper to mkdir with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_mkdir. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -81,7 +81,7 @@ static void __init handle_initrd(void)
|
||||
create_dev("/dev/root.old", Root_RAM0);
|
||||
/* mount initrd on rootfs' /root */
|
||||
mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY);
|
||||
ksys_mkdir("/old", 0700);
|
||||
init_mkdir("/old", 0700);
|
||||
init_chdir("/old");
|
||||
|
||||
/*
|
||||
|
@@ -348,7 +348,7 @@ static int __init do_name(void)
|
||||
state = CopyFile;
|
||||
}
|
||||
} else if (S_ISDIR(mode)) {
|
||||
ksys_mkdir(collected, mode);
|
||||
init_mkdir(collected, mode);
|
||||
init_chown(collected, uid, gid, 0);
|
||||
init_chmod(collected, mode);
|
||||
dir_add(collected, mtime);
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include <linux/stat.h>
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/init_syscalls.h>
|
||||
|
||||
/*
|
||||
* Create a simple rootfs that is similar to the default initramfs
|
||||
@@ -17,7 +18,7 @@ static int __init default_rootfs(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = ksys_mkdir((const char __user __force *) "/dev", 0755);
|
||||
err = init_mkdir("/dev", 0755);
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
@@ -27,7 +28,7 @@ static int __init default_rootfs(void)
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
err = ksys_mkdir((const char __user __force *) "/root", 0700);
|
||||
err = init_mkdir("/root", 0700);
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
|
Reference in New Issue
Block a user