]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
file: Rename __close_fd_get_file close_fd_get_file
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Nov 2020 23:14:40 +0000 (17:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jan 2023 10:39:18 +0000 (11:39 +0100)
[ Upstream commit 9fe83c43e71cdb8e5b9520bcb98706a2b3c680c8 ]

The function close_fd_get_file is explicitly a variant of
__close_fd[1].  Now that __close_fd has been renamed close_fd, rename
close_fd_get_file to be consistent with close_fd.

When __alloc_fd, __close_fd and __fd_install were introduced the
double underscore indicated that the function took a struct
files_struct parameter.  The function __close_fd_get_file never has so
the naming has always been inconsistent.  This just cleans things up
so there are not any lingering mentions or references __close_fd left
in the code.

[1] 80cd795630d6 ("binder: fix use-after-free due to ksys_close() during fdget()")
Link: https://lkml.kernel.org/r/20201120231441.29911-23-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c
fs/file.c
fs/io_uring.c
include/linux/fdtable.h

index 4473adef2f5a49b798ed158d659617ca05548a67..b403c7f063b000a1ee47f4483933e50cdb80d04d 100644 (file)
@@ -2255,7 +2255,7 @@ static void binder_deferred_fd_close(int fd)
        if (!twcb)
                return;
        init_task_work(&twcb->twork, binder_do_fd_close);
-       __close_fd_get_file(fd, &twcb->file);
+       close_fd_get_file(fd, &twcb->file);
        if (twcb->file) {
                filp_close(twcb->file, current->files);
                task_work_add(current, &twcb->twork, TWA_RESUME);
index 8431dfde036cc75bbae793f764755beab731040d..aacc5bf80bd6f1f26b376d14218e71816eb6d091 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -780,11 +780,11 @@ int __close_range(unsigned fd, unsigned max_fd, unsigned int flags)
 }
 
 /*
- * variant of __close_fd that gets a ref on the file for later fput.
+ * variant of close_fd that gets a ref on the file for later fput.
  * The caller must ensure that filp_close() called on the file, and then
  * an fput().
  */
-int __close_fd_get_file(unsigned int fd, struct file **res)
+int close_fd_get_file(unsigned int fd, struct file **res)
 {
        struct files_struct *files = current->files;
        struct file *file;
index 84758e512a04570ca059c8871500d41005f3568a..1d817374131097c833046ad2ce81295604e5cc2a 100644 (file)
@@ -4270,7 +4270,7 @@ static int io_close(struct io_kiocb *req, bool force_nonblock,
 
        /* might be already done during nonblock submission */
        if (!close->put_file) {
-               ret = __close_fd_get_file(close->fd, &close->put_file);
+               ret = close_fd_get_file(close->fd, &close->put_file);
                if (ret < 0)
                        return (ret == -ENOENT) ? -EBADF : ret;
        }
index a32bf47c593e7a04492f90d8eb84469164bfcd7d..f1a99d3e5570712f4a48b3984e9b178208a460de 100644 (file)
@@ -123,7 +123,7 @@ extern void __fd_install(struct files_struct *files,
 extern int __close_fd(struct files_struct *files,
                      unsigned int fd);
 extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags);
-extern int __close_fd_get_file(unsigned int fd, struct file **res);
+extern int close_fd_get_file(unsigned int fd, struct file **res);
 extern int unshare_fd(unsigned long unshare_flags, unsigned int max_fds,
                      struct files_struct **new_fdp);