diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2018-03-20 14:29:53 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2018-04-02 14:15:42 -0400 |
commit | e02af2ff654806c5dc93412fffd77d67d1125ccc (patch) | |
tree | 43f31b20bcc22e244c0c4243d7d5e3c4701a1a74 /fs/fcntl.c | |
parent | 4bdb9acabff2dfcb856c40b6936269d87f490c8d (diff) |
fs: add do_compat_fcntl64() helper; remove in-kernel call to compat syscall
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 <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 12 |
1 files 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) | |||
607 | return 0; | 607 | return 0; |
608 | } | 608 | } |
609 | 609 | ||
610 | COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, | 610 | static long do_compat_fcntl64(unsigned int fd, unsigned int cmd, |
611 | compat_ulong_t, arg) | 611 | compat_ulong_t arg) |
612 | { | 612 | { |
613 | struct fd f = fdget_raw(fd); | 613 | struct fd f = fdget_raw(fd); |
614 | struct flock flock; | 614 | struct flock flock; |
@@ -672,6 +672,12 @@ out_put: | |||
672 | return err; | 672 | return err; |
673 | } | 673 | } |
674 | 674 | ||
675 | COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, | ||
676 | compat_ulong_t, arg) | ||
677 | { | ||
678 | return do_compat_fcntl64(fd, cmd, arg); | ||
679 | } | ||
680 | |||
675 | COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, | 681 | COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, |
676 | compat_ulong_t, arg) | 682 | compat_ulong_t, arg) |
677 | { | 683 | { |
@@ -684,7 +690,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, | |||
684 | case F_OFD_SETLKW: | 690 | case F_OFD_SETLKW: |
685 | return -EINVAL; | 691 | return -EINVAL; |
686 | } | 692 | } |
687 | return compat_sys_fcntl64(fd, cmd, arg); | 693 | return do_compat_fcntl64(fd, cmd, arg); |
688 | } | 694 | } |
689 | #endif | 695 | #endif |
690 | 696 | ||