提交 6214622b 编写于 作者: B Bob Liu 提交者: Cheng Jian

io_uring: clean up io_uring_cancel_files()

mainline inclusion
from mainline-5.5-rc1
commit 2f6d9b9d
category: feature
bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27
CVE: NA
---------------------------

We don't use the return value anymore, drop it. Also drop the
unecessary double cancel_req value check.
Signed-off-by: NBob Liu <bob.liu@oracle.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Nyangerkun <yangerkun@huawei.com>
Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 7a39104e
...@@ -4319,7 +4319,6 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx, ...@@ -4319,7 +4319,6 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx,
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
while (!list_empty_careful(&ctx->inflight_list)) { while (!list_empty_careful(&ctx->inflight_list)) {
enum io_wq_cancel ret = IO_WQ_CANCEL_NOTFOUND;
struct io_kiocb *cancel_req = NULL; struct io_kiocb *cancel_req = NULL;
spin_lock_irq(&ctx->inflight_lock); spin_lock_irq(&ctx->inflight_lock);
...@@ -4337,14 +4336,12 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx, ...@@ -4337,14 +4336,12 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx,
TASK_UNINTERRUPTIBLE); TASK_UNINTERRUPTIBLE);
spin_unlock_irq(&ctx->inflight_lock); 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 */ /* We need to keep going until we don't find a matching req */
if (!cancel_req) if (!cancel_req)
break; break;
io_wq_cancel_work(ctx->io_wq, &cancel_req->work);
io_put_req(cancel_req);
schedule(); schedule();
} }
finish_wait(&ctx->inflight_wait, &wait); finish_wait(&ctx->inflight_wait, &wait);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册