diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-06-02 17:48:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-10-07 13:34:41 -0400 |
commit | cab0515211f483e392d6862021ed008f49058561 (patch) | |
tree | a66afb5ecdcb021ac742e62989a264acaaa6562e /fs/file.c | |
parent | 1fa4ffd8e6f6d001da27f00382af79bad0336091 (diff) | |
download | lwn-cab0515211f483e392d6862021ed008f49058561.tar.gz lwn-cab0515211f483e392d6862021ed008f49058561.zip |
move close_range(2) into fs/file.c, fold __close_range() into it
We never had callers for __close_range() except for close_range(2)
itself. Nothing of that sort has appeared in four years and if any users
do show up, we can always separate those suckers again.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file.c')
-rw-r--r-- | fs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/file.c b/fs/file.c index 8770010170c5..8e8f504782bf 100644 --- a/fs/file.c +++ b/fs/file.c @@ -713,7 +713,7 @@ static inline void __range_close(struct files_struct *files, unsigned int fd, } /** - * __close_range() - Close all file descriptors in a given range. + * sys_close_range() - Close all file descriptors in a given range. * * @fd: starting file descriptor to close * @max_fd: last file descriptor to close @@ -721,8 +721,10 @@ static inline void __range_close(struct files_struct *files, unsigned int fd, * * This closes a range of file descriptors. All file descriptors * from @fd up to and including @max_fd are closed. + * Currently, errors to close a given file descriptor are ignored. */ -int __close_range(unsigned fd, unsigned max_fd, unsigned int flags) +SYSCALL_DEFINE3(close_range, unsigned int, fd, unsigned int, max_fd, + unsigned int, flags) { struct task_struct *me = current; struct files_struct *cur_fds = me->files, *fds = NULL; |