From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dominik Brodowski Subject: [PATCH 058/109] fs: add do_compat_fcntl64() helper; remove in-kernel call to compat syscall Date: Thu, 29 Mar 2018 13:23:35 +0200 Message-ID: <20180329112426.23043-59-linux@dominikbrodowski.net> References: <20180329112426.23043-1-linux@dominikbrodowski.net> Return-path: In-Reply-To: <20180329112426.23043-1-linux@dominikbrodowski.net> Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org, arnd@arndb.de, linux-arch@vger.kernel.org, Al Viro , Andrew Morton List-Id: linux-arch.vger.kernel.org Using the fs-internal do_compat_fcntl64() helper allows us to get rid of the fs-internal call to the compat_sys_fcntl64() syscall. 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 --- fs/fcntl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/fcntl.c b/fs/fcntl.c index 1e97f1fda90c..d737ff082472 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -607,8 +607,8 @@ static int fixup_compat_flock(struct flock *flock) return 0; } -COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, - compat_ulong_t, arg) +static long do_compat_fcntl64(unsigned int fd, unsigned int cmd, + compat_ulong_t arg) { struct fd f = fdget_raw(fd); struct flock flock; @@ -672,6 +672,12 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, return err; } +COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, + compat_ulong_t, arg) +{ + return do_compat_fcntl64(fd, cmd, arg); +} + COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, compat_ulong_t, arg) { @@ -684,7 +690,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, case F_OFD_SETLKW: return -EINVAL; } - return compat_sys_fcntl64(fd, cmd, arg); + return do_compat_fcntl64(fd, cmd, arg); } #endif -- 2.16.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from isilmar-4.linta.de ([136.243.71.142]:59398 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752754AbeC2L0K (ORCPT ); Thu, 29 Mar 2018 07:26:10 -0400 From: Dominik Brodowski Subject: [PATCH 058/109] fs: add do_compat_fcntl64() helper; remove in-kernel call to compat syscall Date: Thu, 29 Mar 2018 13:23:35 +0200 Message-ID: <20180329112426.23043-59-linux@dominikbrodowski.net> In-Reply-To: <20180329112426.23043-1-linux@dominikbrodowski.net> References: <20180329112426.23043-1-linux@dominikbrodowski.net> Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-kernel@vger.kernel.org Cc: viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org, arnd@arndb.de, linux-arch@vger.kernel.org, Al Viro , Andrew Morton Message-ID: <20180329112335.BSeuoImM8OLUYvYsK-VhPE60-2v7kS6Ali02pwOCJEw@z> Using the fs-internal do_compat_fcntl64() helper allows us to get rid of the fs-internal call to the compat_sys_fcntl64() syscall. 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 --- fs/fcntl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/fcntl.c b/fs/fcntl.c index 1e97f1fda90c..d737ff082472 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -607,8 +607,8 @@ static int fixup_compat_flock(struct flock *flock) return 0; } -COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, - compat_ulong_t, arg) +static long do_compat_fcntl64(unsigned int fd, unsigned int cmd, + compat_ulong_t arg) { struct fd f = fdget_raw(fd); struct flock flock; @@ -672,6 +672,12 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, return err; } +COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, + compat_ulong_t, arg) +{ + return do_compat_fcntl64(fd, cmd, arg); +} + COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, compat_ulong_t, arg) { @@ -684,7 +690,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, case F_OFD_SETLKW: return -EINVAL; } - return compat_sys_fcntl64(fd, cmd, arg); + return do_compat_fcntl64(fd, cmd, arg); } #endif -- 2.16.3