public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 4/8] io_uring: explicitly pass tctx into del_task_file
Date: Fri, 18 Dec 2020 13:12:24 +0000	[thread overview]
Message-ID: <b800dfdf749a45b5ceffe016b11bd9d7d4ee7490.1608296656.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Pass tctx to io_uring_del_task_file() from above. No functional changes.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3a3177739b13..1794ad4bfa39 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8882,10 +8882,9 @@ static int io_uring_add_task_file(struct io_ring_ctx *ctx, struct file *file)
 /*
  * Remove this io_uring_file -> task mapping.
  */
-static void io_uring_del_task_file(struct file *file)
+static void io_uring_del_task_file(struct io_uring_task *tctx,
+				   struct file *file)
 {
-	struct io_uring_task *tctx = current->io_uring;
-
 	if (tctx->last == file)
 		tctx->last = NULL;
 	file = xa_erase(&tctx->xa, (unsigned long)file);
@@ -8907,7 +8906,7 @@ static void io_uring_attempt_task_drop(struct file *file)
 	 */
 	if (fatal_signal_pending(current) || (current->flags & PF_EXITING) ||
 	    atomic_long_read(&file->f_count) == 2)
-		io_uring_del_task_file(file);
+		io_uring_del_task_file(current->io_uring, file);
 }
 
 void __io_uring_files_cancel(struct files_struct *files)
@@ -8924,7 +8923,7 @@ void __io_uring_files_cancel(struct files_struct *files)
 
 		io_uring_cancel_task_requests(ctx, files);
 		if (files)
-			io_uring_del_task_file(file);
+			io_uring_del_task_file(tctx, file);
 	}
 
 	atomic_dec(&tctx->in_idle);
-- 
2.24.0


  parent reply	other threads:[~2020-12-18 13:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 13:12 [PATCH 0/8] a fix + cancellation unification Pavel Begunkov
2020-12-18 13:12 ` [PATCH 1/8] io_uring: close a small race gap for files cancel Pavel Begunkov
2020-12-18 13:12 ` [PATCH 2/8] io_uring: further deduplicate #CQ events calc Pavel Begunkov
2020-12-18 13:12 ` [PATCH 3/8] io_uring: account per-task #requests with files Pavel Begunkov
2020-12-18 13:12 ` Pavel Begunkov [this message]
2020-12-18 13:12 ` [PATCH 5/8] io_uring: draft files cancel based on inflight cnt Pavel Begunkov
2020-12-18 13:12 ` [PATCH 6/8] io_uring: remove old files cancel mechanism Pavel Begunkov
2020-12-18 13:12 ` [PATCH 7/8] io_uring: cleanup task cancel Pavel Begunkov
2020-12-18 13:12 ` [PATCH 8/8] io_uring: kill not used anymore inflight_lock Pavel Begunkov
2020-12-18 15:16 ` [PATCH 0/8] a fix + cancellation unification Jens Axboe
2020-12-18 15:22   ` Pavel Begunkov

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=b800dfdf749a45b5ceffe016b11bd9d7d4ee7490.1608296656.git.asml.silence@gmail.com \
    [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