[PATCH 3/3] io_uring: have io_file_put() take an io_kiocb rather than the file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No functional changes in this patch, just a prep patch for needing the
request in io_file_put().

Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
 io_uring/io_uring.c | 4 ++--
 io_uring/io_uring.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 3da26171599b..138635e66d44 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1004,7 +1004,7 @@ static void __io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
 		if (unlikely(req->flags & IO_REQ_CLEAN_FLAGS))
 			io_clean_op(req);
 		if (!(req->flags & REQ_F_FIXED_FILE))
-			io_put_file(req->file);
+			io_put_file(req);
 
 		rsrc_node = req->rsrc_node;
 		/*
@@ -1539,7 +1539,7 @@ void io_free_batch_list(struct io_ring_ctx *ctx, struct io_wq_work_node *node)
 				io_clean_op(req);
 		}
 		if (!(req->flags & REQ_F_FIXED_FILE))
-			io_put_file(req->file);
+			io_put_file(req);
 
 		io_req_put_rsrc_locked(req, ctx);
 
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 12769bad5cee..46643bc9f3c5 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -196,10 +196,10 @@ static inline bool req_has_async_data(struct io_kiocb *req)
 	return req->flags & REQ_F_ASYNC_DATA;
 }
 
-static inline void io_put_file(struct file *file)
+static inline void io_put_file(struct io_kiocb *req)
 {
-	if (file)
-		fput(file);
+	if (req->file)
+		fput(req->file);
 }
 
 static inline void io_ring_submit_unlock(struct io_ring_ctx *ctx,
-- 
2.40.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux