Commit e02af2ff authored by Dominik Brodowski's avatar Dominik Brodowski

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: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 4bdb9aca
...@@ -607,8 +607,8 @@ static int fixup_compat_flock(struct flock *flock) ...@@ -607,8 +607,8 @@ static int fixup_compat_flock(struct flock *flock)
return 0; return 0;
} }
COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, static long do_compat_fcntl64(unsigned int fd, unsigned int cmd,
compat_ulong_t, arg) compat_ulong_t arg)
{ {
struct fd f = fdget_raw(fd); struct fd f = fdget_raw(fd);
struct flock flock; struct flock flock;
...@@ -672,6 +672,12 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd, ...@@ -672,6 +672,12 @@ COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
return err; 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_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd,
compat_ulong_t, arg) compat_ulong_t, arg)
{ {
...@@ -684,7 +690,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, ...@@ -684,7 +690,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd,
case F_OFD_SETLKW: case F_OFD_SETLKW:
return -EINVAL; return -EINVAL;
} }
return compat_sys_fcntl64(fd, cmd, arg); return do_compat_fcntl64(fd, cmd, arg);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment