From: Xiaoguang Wang <[email protected]>
To: [email protected]
Cc: [email protected], [email protected]
Subject: [PATCH 5.11 1/2] io_uring: keep a pointer ref_node in io_kiocb
Date: Tue, 17 Nov 2020 14:17:22 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Basically no functional changes in this patch, just a preparation
for later patch.
Signed-off-by: Xiaoguang Wang <[email protected]>
---
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 edfd7c3b8de6..219609c38e48 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -714,7 +714,7 @@ struct io_kiocb {
u64 user_data;
struct io_kiocb *link;
- struct percpu_ref *fixed_file_refs;
+ struct fixed_file_ref_node *ref_node;
/*
* 1. used with ctx->iopoll_list with reads/writes
@@ -1927,7 +1927,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);
}
@@ -6344,8 +6344,8 @@ static struct file *io_file_get(struct io_submit_state *state,
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);
--
2.17.2
next prev parent reply other threads:[~2020-11-17 6:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-17 6:17 [PATCH 5.11 0/2] registered files improvements for IOPOLL mode Xiaoguang Wang
2020-11-17 6:17 ` Xiaoguang Wang [this message]
2020-11-17 6:17 ` [PATCH 5.11 2/2] io_uring: don't take percpu_ref operations for registered files in " Xiaoguang Wang
2020-11-17 10:43 ` Pavel Begunkov
2020-11-17 16:21 ` Xiaoguang Wang
2020-11-17 16:42 ` Pavel Begunkov
2020-11-17 16:30 ` Jens Axboe
2020-11-17 16:58 ` Pavel Begunkov
2020-11-18 1:42 ` Jens Axboe
2020-11-18 13:59 ` Pavel Begunkov
2020-11-18 14:59 ` Jens Axboe
2020-11-18 15:36 ` Xiaoguang Wang
2020-11-18 15:52 ` Pavel Begunkov
2020-11-18 15:57 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201117061723.18131-2-xiaoguang.wang@linux.alibaba.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox