summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-12-11 22:10:35 +0100
committerJens Axboe <axboe@kernel.dk>2020-01-21 01:01:53 +0100
commit6e802a4ba056a6f2f51ac9d54eead3ed6f9829a2 (patch)
tree1fcd466f66bb1d54d2737ecbdec83a500649961b /fs
parentio_uring: add support for IORING_OP_OPENAT (diff)
downloadlinux-6e802a4ba056a6f2f51ac9d54eead3ed6f9829a2.tar.xz
linux-6e802a4ba056a6f2f51ac9d54eead3ed6f9829a2.zip
fs: move filp_close() outside of __close_fd_get_file()
Just one caller of this, and just use filp_close() there manually. This is important to allow async close/removal of the fd. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/file.c b/fs/file.c
index 3da91a112bab..fb7081bfac2b 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -642,7 +642,9 @@ out_unlock:
EXPORT_SYMBOL(__close_fd); /* for ksys_close() */
/*
- * 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)
{
@@ -662,7 +664,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
spin_unlock(&files->file_lock);
get_file(file);
*res = file;
- return filp_close(file, files);
+ return 0;
out_unlock:
spin_unlock(&files->file_lock);