summaryrefslogtreecommitdiffstats
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2018-03-11 11:34:56 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2018-04-02 20:16:01 +0200
commitbae217ea8c7e123ed3fb1064909a262924771bbb (patch)
tree52e92c1130a87a5985698e469ee8673679553dd2 /init/initramfs.c
parent2ca2a09d6215fd9621aa3e2db7cc9428a61f2911 (diff)
downloadlinux-bae217ea8c7e123ed3fb1064909a262924771bbb.tar.gz
linux-bae217ea8c7e123ed3fb1064909a262924771bbb.tar.bz2
linux-bae217ea8c7e123ed3fb1064909a262924771bbb.zip
fs: add ksys_open() wrapper; remove in-kernel calls to sys_open()
Using this wrapper allows us to avoid the in-kernel calls to the sys_open() syscall. The ksys_ prefix denotes that this function is meant as a drop-in replacement for the syscall. In particular, it uses the same calling convention as sys_open(). This patch is part of a series which removes in-kernel calls to syscalls. On this basis, the syscall entry path can be streamlined. For details, see http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index ce2bcad97cdf..5f2ff1d2370e 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -340,7 +340,7 @@ static int __init do_name(void)
int openflags = O_WRONLY|O_CREAT;
if (ml != 1)
openflags |= O_TRUNC;
- wfd = sys_open(collected, openflags, mode);
+ wfd = ksys_open(collected, openflags, mode);
if (wfd >= 0) {
ksys_fchown(wfd, uid, gid);
@@ -567,7 +567,7 @@ static void __init clean_rootfs(void)
struct linux_dirent64 *dirp;
int num;
- fd = sys_open("/", O_RDONLY, 0);
+ fd = ksys_open("/", O_RDONLY, 0);
WARN_ON(fd < 0);
if (fd < 0)
return;
@@ -629,7 +629,7 @@ static int __init populate_rootfs(void)
}
printk(KERN_INFO "rootfs image is not initramfs (%s)"
"; looks like an initrd\n", err);
- fd = sys_open("/initrd.image",
+ fd = ksys_open("/initrd.image",
O_WRONLY|O_CREAT, 0700);
if (fd >= 0) {
ssize_t written = xwrite(fd, (char *)initrd_start,