All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fs:io_uring: clean up io_uring_cancel_files
@ 2019-11-13 10:06 Bob Liu
  2019-11-13 10:06 ` [PATCH 2/2] fs: io_uring: introduce req_need_defer() Bob Liu
  2019-11-13 19:37 ` [PATCH 1/2] fs:io_uring: clean up io_uring_cancel_files Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Bob Liu @ 2019-11-13 10:06 UTC (permalink / raw)
  To: axboe; +Cc: io-uring, Bob Liu

return val is not used, drop it.
Also drop unnecessary if (cancel_req).

Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 fs/io_uring.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 247e5e1..5781bfe 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4286,7 +4286,6 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx,
 	DEFINE_WAIT(wait);
 
 	while (!list_empty_careful(&ctx->inflight_list)) {
-		enum io_wq_cancel ret = IO_WQ_CANCEL_NOTFOUND;
 		struct io_kiocb *cancel_req = NULL;
 
 		spin_lock_irq(&ctx->inflight_lock);
@@ -4304,14 +4303,12 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx,
 						TASK_UNINTERRUPTIBLE);
 		spin_unlock_irq(&ctx->inflight_lock);
 
-		if (cancel_req) {
-			ret = io_wq_cancel_work(ctx->io_wq, &cancel_req->work);
-			io_put_req(cancel_req);
-		}
-
 		/* We need to keep going until we don't find a matching req */
 		if (!cancel_req)
 			break;
+
+		io_wq_cancel_work(ctx->io_wq, &cancel_req->work);
+		io_put_req(cancel_req);
 		schedule();
 	}
 	finish_wait(&ctx->inflight_wait, &wait);
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-13 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 10:06 [PATCH 1/2] fs:io_uring: clean up io_uring_cancel_files Bob Liu
2019-11-13 10:06 ` [PATCH 2/2] fs: io_uring: introduce req_need_defer() Bob Liu
2019-11-13 19:37 ` [PATCH 1/2] fs:io_uring: clean up io_uring_cancel_files Jens Axboe

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.