diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2018-03-11 06:34:29 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2018-04-02 14:15:37 -0400 |
commit | f13903587c189fa73da47ddd416eb31704c48486 (patch) | |
tree | fbbac26720351248b56079f36ce676b45f7f0e8f | |
parent | ee81feb64ead8e4bed0ebc94c980e6cd836aaafd (diff) |
fs: add do_futimesat() helper; remove internal call to sys_futimesat()
Using this helper removes the in-kernel call to the 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: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | fs/utimes.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/utimes.c b/fs/utimes.c index e4b3d7c2c9f5..5be035ed26c0 100644 --- a/fs/utimes.c +++ b/fs/utimes.c | |||
@@ -184,8 +184,8 @@ SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename, | |||
184 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); | 184 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, flags); |
185 | } | 185 | } |
186 | 186 | ||
187 | SYSCALL_DEFINE3(futimesat, int, dfd, const char __user *, filename, | 187 | static long do_futimesat(int dfd, const char __user *filename, |
188 | struct timeval __user *, utimes) | 188 | struct timeval __user *utimes) |
189 | { | 189 | { |
190 | struct timeval times[2]; | 190 | struct timeval times[2]; |
191 | struct timespec64 tstimes[2]; | 191 | struct timespec64 tstimes[2]; |
@@ -212,10 +212,17 @@ SYSCALL_DEFINE3(futimesat, int, dfd, const char __user *, filename, | |||
212 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); | 212 | return do_utimes(dfd, filename, utimes ? tstimes : NULL, 0); |
213 | } | 213 | } |
214 | 214 | ||
215 | |||
216 | SYSCALL_DEFINE3(futimesat, int, dfd, const char __user *, filename, | ||
217 | struct timeval __user *, utimes) | ||
218 | { | ||
219 | return do_futimesat(dfd, filename, utimes); | ||
220 | } | ||
221 | |||
215 | SYSCALL_DEFINE2(utimes, char __user *, filename, | 222 | SYSCALL_DEFINE2(utimes, char __user *, filename, |
216 | struct timeval __user *, utimes) | 223 | struct timeval __user *, utimes) |
217 | { | 224 | { |
218 | return sys_futimesat(AT_FDCWD, filename, utimes); | 225 | return do_futimesat(AT_FDCWD, filename, utimes); |
219 | } | 226 | } |
220 | 227 | ||
221 | #ifdef CONFIG_COMPAT | 228 | #ifdef CONFIG_COMPAT |