From 182489f64304285712ea349c45e6af10fd907341 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wang Date: Tue, 10 Nov 2020 11:50:01 +0800 Subject: [PATCH 2328/2944] alinux: io_uring: keep a pointer ref_node in io_kiocb to #30251548 Basically no functional changes in this patch, just a preparation for later patch. Signed-off-by: Xiaoguang Wang Reviewed-by: Joseph Qi --- fs/io_uring.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index c375347..d5587a3 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -685,7 +685,7 @@ struct io_kiocb { struct list_head inflight_entry; - struct percpu_ref *fixed_file_refs; + struct fixed_file_ref_node *ref_node; union { /* @@ -1442,7 +1442,7 @@ static inline void io_put_file(struct io_kiocb *req, struct file *file, bool fixed) { if (fixed) - percpu_ref_put(req->fixed_file_refs); + percpu_ref_put(&req->ref_node->refs); else fput(file); } @@ -5867,8 +5867,8 @@ static int io_file_get(struct io_submit_state *state, struct io_kiocb *req, fd = array_index_nospec(fd, ctx->nr_user_files); file = io_file_from_index(ctx, fd); if (file) { - req->fixed_file_refs = &ctx->file_data->node->refs; - percpu_ref_get(req->fixed_file_refs); + req->ref_node = ctx->file_data->node; + percpu_ref_get(&req->ref_node->refs); } } else { trace_io_uring_file_get(ctx, fd); -- 1.8.3.1