From eef404784c948652f3965125c5679beeb6037ce3 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Tue, 19 Nov 2024 12:59:08 +0100 Subject: [PATCH] Revert "file: Replace ksys_close with close_fd" This reverts commit d7b5b6740b4e6e1122a1bfe8aad033eee26d0051. --- fs/autofs/dev-ioctl.c | 5 ++--- include/linux/syscalls.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c index 5bf781ea6..322b7dfb4 100755 --- a/fs/autofs/dev-ioctl.c +++ b/fs/autofs/dev-ioctl.c @@ -4,10 +4,9 @@ * Copyright 2008 Ian Kent */ -#include #include #include -#include +#include #include #include @@ -290,7 +289,7 @@ static int autofs_dev_ioctl_closemount(struct file *fp, struct autofs_sb_info *sbi, struct autofs_dev_ioctl *param) { - return close_fd(param->ioctlfd); + return ksys_close(param->ioctlfd); } /* diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index ec4cea5dd..212ec79e6 100755 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -1321,6 +1321,18 @@ static inline long ksys_ftruncate(unsigned int fd, loff_t length) return do_sys_ftruncate(fd, length, 1); } +extern int close_fd(unsigned int fd); + +/* + * In contrast to sys_close(), this stub does not check whether the syscall + * should or should not be restarted, but returns the raw error codes from + * close_fd(). + */ +static inline int ksys_close(unsigned int fd) +{ + return close_fd(fd); +} + extern long do_sys_truncate(const char __user *pathname, loff_t length); static inline long ksys_truncate(const char __user *pathname, loff_t length)