summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-07-07 11:14:40 -0600
committerJens Axboe <axboe@kernel.dk>2023-08-10 10:27:46 -0600
commit17bc28374cd06b7d2d3f1e88470ef89f9cd3a497 (patch)
treeec50652e492b813100116ec7a70c59ab2cd36fa7 /io_uring/io_uring.h
parent9f69a259576ad46e6a13812b2c272bc9a89f8e03 (diff)
io_uring: have io_file_put() take an io_kiocb rather than the file
No functional changes in this patch, just a prep patch for needing the request in io_file_put(). Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.h')
-rw-r--r--io_uring/io_uring.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 12769bad5cee..ff153af28236 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->flags & REQ_F_FIXED_FILE) && req->file)
+ fput(req->file);
}
static inline void io_ring_submit_unlock(struct io_ring_ctx *ctx,