Commit 2f6d9b9d authored by Bob Liu's avatar Bob Liu Committed by Jens Axboe
Browse files

io_uring: clean up io_uring_cancel_files()



We don't use the return value anymore, drop it. Also drop the
unecessary double cancel_req value check.

Signed-off-by: default avatarBob Liu <bob.liu@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e61df66c
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -4303,7 +4303,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);
@@ -4321,14 +4320,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);