]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
io_uring: clean up io_uring_cancel_files()
authorBob Liu <bob.liu@oracle.com>
Wed, 13 Nov 2019 10:06:24 +0000 (18:06 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Nov 2019 02:41:01 +0000 (19:41 -0700)
We don't use the return value anymore, drop it. Also drop the
unecessary double cancel_req value check.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index e1a3b8b667e09695421d34aa455dc6f465c80f73..297b9e80dc5c54be62c2a6c1c3c5b3e0cf2c4e0c 100644 (file)
@@ -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);