Re: [PATCH 3/3] fs: remove do_sys_truncate
Jan Kara <[email protected]>
| Newsgroups | gmane.linux.ports.ppc.embedded,gmane.linux.ports.arm.kernel,gmane.linux.ports.mips,gmane.linux.ports.parisc,gmane.linux.ports.sparc,gmane.linux.file-systems,gmane.linux.kernel.api |
|---|---|
| Message-ID | <yggi6tpu3uptzwe4an55ufkqgrrxkhu6e3sftlmgmny74c5w2m@4hapz3ee6kqv> |
On Mon 23-03-26 08:01:46, Christoph Hellwig wrote: > do_sys_truncate ist only used to implement ksys_truncate and the native > truncate syscalls. Merge do_sys_truncate into ksys_truncate and return > int from it as it only returns 0 or negative errnos. > > Signed-off-by: Christoph Hellwig <[email protected]> Looks good. Feel free to add: Reviewed-by: Jan Kara <[email protected]> Honza > --- > fs/open.c | 8 ++++---- > include/linux/syscalls.h | 8 +------- > 2 files changed, 5 insertions(+), 11 deletions(-) > > diff --git a/fs/open.c b/fs/open.c > index 181c1597e73c..681d405bc61e 100644 > --- a/fs/open.c > +++ b/fs/open.c > @@ -126,7 +126,7 @@ int vfs_truncate(const struct path *path, loff_t length) > } > EXPORT_SYMBOL_GPL(vfs_truncate); > > -int do_sys_truncate(const char __user *pathname, loff_t length) > +int ksys_truncate(const char __user *pathname, loff_t length) > { > unsigned int lookup_flags = LOOKUP_FOLLOW; > struct path path; > @@ -151,13 +151,13 @@ int do_sys_truncate(const char __user *pathname, loff_t length) > > SYSCALL_DEFINE2(truncate, const char __user *, path, long, length) > { > - return do_sys_truncate(path, length); > + return ksys_truncate(path, length); > } > > #ifdef CONFIG_COMPAT > COMPAT_SYSCALL_DEFINE2(truncate, const char __user *, path, compat_off_t, length) > { > - return do_sys_truncate(path, length); > + return ksys_truncate(path, length); > } > #endif > > @@ -222,7 +222,7 @@ COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_off_t, length) > #if BITS_PER_LONG == 32 > SYSCALL_DEFINE2(truncate64, const char __user *, path, loff_t, length) > { > - return do_sys_truncate(path, length); > + return ksys_truncate(path, length); > } > > SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length) > diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h > index 8787b3511c86..f5639d5ac331 100644 > --- a/include/linux/syscalls.h > +++ b/include/linux/syscalls.h > @@ -1285,13 +1285,7 @@ static inline long ksys_lchown(const char __user *filename, uid_t user, > > #define FTRUNCATE_LFS (1u << 0) /* allow truncating > 32-bit */ > int ksys_ftruncate(unsigned int fd, loff_t length, unsigned int flags); > - > -int do_sys_truncate(const char __user *pathname, loff_t length); > - > -static inline long ksys_truncate(const char __user *pathname, loff_t length) > -{ > - return do_sys_truncate(pathname, length); > -} > +int ksys_truncate(const char __user *pathname, loff_t length); > > static inline unsigned int ksys_personality(unsigned int personality) > { > -- > 2.47.3 > -- Jan Kara <[email protected]> SUSE Labs, CR