Skip to content

Commit

Permalink
file: Replace ksys_close with close_fd
Browse files Browse the repository at this point in the history
Now that ksys_close is exactly identical to close_fd replace
the one caller of ksys_close with close_fd.

[1] https://lkml.kernel.org/r/[email protected]
Suggested-by: Christoph Hellwig <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
ebiederm committed Dec 10, 2020
1 parent 8760c90 commit 1572bfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
5 changes: 3 additions & 2 deletions fs/autofs/dev-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* Copyright 2008 Ian Kent <[email protected]>
*/

#include <linux/module.h>
#include <linux/miscdevice.h>
#include <linux/compat.h>
#include <linux/syscalls.h>
#include <linux/fdtable.h>
#include <linux/magic.h>
#include <linux/nospec.h>

Expand Down Expand Up @@ -289,7 +290,7 @@ static int autofs_dev_ioctl_closemount(struct file *fp,
struct autofs_sb_info *sbi,
struct autofs_dev_ioctl *param)
{
return ksys_close(param->ioctlfd);
return close_fd(param->ioctlfd);
}

/*
Expand Down
12 changes: 0 additions & 12 deletions include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -1295,18 +1295,6 @@ 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)
Expand Down

0 comments on commit 1572bfd

Please sign in to comment.