From 03450e271a160bc07a2c48e5769e0ba338582d77 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 11 Mar 2018 11:34:53 +0100 Subject: fs: add ksys_fchmod() and do_fchmodat() helpers and ksys_chmod() wrapper; remove in-kernel calls to syscall Using the fs-internal do_fchmodat() helper allows us to get rid of fs-internal calls to the sys_fchmodat() syscall. Introducing the ksys_fchmod() helper and the ksys_chmod() wrapper allows us to avoid the in-kernel calls to the sys_fchmod() and sys_chmod() syscalls. The ksys_ prefix denotes that these functions are meant as a drop-in replacement for the syscalls. In particular, they use the same calling convention as sys_fchmod() and sys_chmod(). 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 Cc: Andrew Morton Signed-off-by: Dominik Brodowski --- init/initramfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'init') diff --git a/init/initramfs.c b/init/initramfs.c index 5855ab632b4e..16c3c23076e2 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -344,7 +344,7 @@ static int __init do_name(void) if (wfd >= 0) { sys_fchown(wfd, uid, gid); - sys_fchmod(wfd, mode); + ksys_fchmod(wfd, mode); if (body_len) sys_ftruncate(wfd, body_len); vcollected = kstrdup(collected, GFP_KERNEL); @@ -354,14 +354,14 @@ static int __init do_name(void) } else if (S_ISDIR(mode)) { ksys_mkdir(collected, mode); sys_chown(collected, uid, gid); - sys_chmod(collected, mode); + ksys_chmod(collected, mode); dir_add(collected, mtime); } else if (S_ISBLK(mode) || S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { if (maybe_link() == 0) { ksys_mknod(collected, mode, rdev); sys_chown(collected, uid, gid); - sys_chmod(collected, mode); + ksys_chmod(collected, mode); do_utime(collected, mtime); } } -- cgit v1.2.3-59-g8ed1b