]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.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)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 10 Dec 2020 18:42:59 +0000 (12:42 -0600)
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>
drivers/android/binder.c
fs/file.c
fs/io_uring.c
include/linux/fdtable.h

index b5117576792bc6ac6cc06da69d2cf6f43c95261f..5b2e3721ac27c1ef856ec3612c50fcad287abaf8 100644 (file)
@@ -2226,7 +2226,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 987ea51630b442d8c4aa9257afcd282ee3cbe9de..947ac6d5602f268ea69f7119291adb1c1003ba1f 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -721,11 +721,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 b42dfa0243bfd5ecf83caf903044a724a3919e76..2e6e51292effc0933fd926c634713f6f094bed26 100644 (file)
@@ -4206,7 +4206,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 dad4a488ce60e5a1f59006c044f0cbabdd66dbbe..4ed3589f9294e94ed3c560ddba8ab834c2c4c246 100644 (file)
@@ -126,7 +126,7 @@ int iterate_fd(struct files_struct *, unsigned,
 
 extern int close_fd(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);