]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
file: Rename __close_fd to close_fd and remove the files parameter
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Nov 2020 23:14:38 +0000 (17:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2024 12:52:49 +0000 (14:52 +0200)
commit6d256a904cd700fb374f689697901686bf3e9bdd
treebb8b3a78e0f0613d735a709cf003d58663374c7a
parent7458c5ae465ef8f052e5bb5a7c4755e9c755d752
file: Rename __close_fd to close_fd and remove the files parameter

[ Upstream commit 8760c909f54a82aaa6e76da19afe798a0c77c3c3 ]

The function __close_fd was added to support binder[1].  Now that
binder has been fixed to no longer need __close_fd[2] all calls
to __close_fd pass current->files.

Therefore transform the files parameter into a local variable
initialized to current->files, and rename __close_fd to close_fd to
reflect this change, and keep it in sync with the similar changes to
__alloc_fd, and __fd_install.

This removes the need for callers to care about the extra care that
needs to be take if anything except current->files is passed, by
limiting the callers to only operation on current->files.

[1] 483ce1d4b8c3 ("take descriptor-related part of close() to file.c")
[2] 44d8047f1d87 ("binder: use standard functions to allocate fds")
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
v1: https://lkml.kernel.org/r/20200817220425.9389-17-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20201120231441.29911-21-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/file.c
fs/open.c
include/linux/fdtable.h
include/linux/syscalls.h