]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fs: add do_compat_futimesat() helper; remove in-kernel call to compat syscall
authorDominik Brodowski <linux@dominikbrodowski.net>
Tue, 20 Mar 2018 18:39:44 +0000 (19:39 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Mon, 2 Apr 2018 18:15:44 +0000 (20:15 +0200)
Using the fs-internal do_compat_futimesat() helper allows us to get rid of
the fs-internal call to the compat_sys_futimesat() 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>
fs/utimes.c

index 5be035ed26c0b2470278f14ace71bf2f33b0130f..69d4b6ba1bfb685489e27f06b21d94c95aa7f2a0 100644 (file)
@@ -260,7 +260,8 @@ COMPAT_SYSCALL_DEFINE4(utimensat, unsigned int, dfd, const char __user *, filena
        return do_utimes(dfd, filename, t ? tv : NULL, flags);
 }
 
-COMPAT_SYSCALL_DEFINE3(futimesat, unsigned int, dfd, const char __user *, filename, struct compat_timeval __user *, t)
+static long do_compat_futimesat(unsigned int dfd, const char __user *filename,
+                               struct compat_timeval __user *t)
 {
        struct timespec64 tv[2];
 
@@ -279,8 +280,15 @@ COMPAT_SYSCALL_DEFINE3(futimesat, unsigned int, dfd, const char __user *, filena
        return do_utimes(dfd, filename, t ? tv : NULL, 0);
 }
 
+COMPAT_SYSCALL_DEFINE3(futimesat, unsigned int, dfd,
+                      const char __user *, filename,
+                      struct compat_timeval __user *, t)
+{
+       return do_compat_futimesat(dfd, filename, t);
+}
+
 COMPAT_SYSCALL_DEFINE2(utimes, const char __user *, filename, struct compat_timeval __user *, t)
 {
-       return compat_sys_futimesat(AT_FDCWD, filename, t);
+       return do_compat_futimesat(AT_FDCWD, filename, t);
 }
 #endif