All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 5/6] io_uring: drop confusion between cleanup flags
Date: Tue, 24 May 2022 15:37:26 -0600	[thread overview]
Message-ID: <20220524213727.409630-6-axboe@kernel.dk> (raw)
In-Reply-To: <20220524213727.409630-1-axboe@kernel.dk>

If the opcode only stores data that needs to be kfree'ed in
req->async_data, then it doesn't need special handling in
our cleanup handler.

This has the added bonus of removing knowledge of those kinds of
special async_data to the io_uring core.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/io_uring.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 408265a03563..8188c47956ad 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8229,24 +8229,6 @@ static void io_clean_op(struct io_kiocb *req)
 
 	if (req->flags & REQ_F_NEED_CLEANUP) {
 		switch (req->opcode) {
-		case IORING_OP_READV:
-		case IORING_OP_READ_FIXED:
-		case IORING_OP_READ:
-		case IORING_OP_WRITEV:
-		case IORING_OP_WRITE_FIXED:
-		case IORING_OP_WRITE: {
-			struct io_async_rw *io = req->async_data;
-
-			kfree(io->free_iovec);
-			break;
-			}
-		case IORING_OP_RECVMSG:
-		case IORING_OP_SENDMSG: {
-			struct io_async_msghdr *io = req->async_data;
-
-			kfree(io->free_iov);
-			break;
-			}
 		case IORING_OP_OPENAT:
 		case IORING_OP_OPENAT2:
 			if (req->open.filename)
-- 
2.35.1


  parent reply	other threads:[~2022-05-24 21:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 21:37 [PATCHSET 0/6] Misc cleanups Jens Axboe
2022-05-24 21:37 ` [PATCH 1/6] io_uring: make timeout prep handlers consistent with other prep handlers Jens Axboe
2022-05-25  6:16   ` Kanchan Joshi
2022-05-24 21:37 ` [PATCH 2/6] io_uring: make prep and issue side of req handlers named consistently Jens Axboe
2022-05-25  6:06   ` Kanchan Joshi
2022-05-24 21:37 ` [PATCH 3/6] io_uring: add io_op_defs 'def' pointer in req init and issue Jens Axboe
2022-05-25  6:41   ` Kanchan Joshi
2022-05-25 11:37     ` Jens Axboe
2022-05-24 21:37 ` [PATCH 4/6] io_uring: unify calling convention for async prep handling Jens Axboe
2022-05-24 21:37 ` Jens Axboe [this message]
2022-05-25  8:46   ` [PATCH 5/6] io_uring: drop confusion between cleanup flags Kanchan Joshi
2022-05-25 11:34     ` Jens Axboe
2022-05-24 21:37 ` [PATCH 6/6] io_uring: move shutdown under the general net section 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=20220524213727.409630-6-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.