Commit 93e06b41 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Adrian Bunk

BUG_ON conversion for fs/aio.c

This patch converts a if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.
Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent d99c5909
...@@ -367,8 +367,7 @@ void fastcall __put_ioctx(struct kioctx *ctx) ...@@ -367,8 +367,7 @@ void fastcall __put_ioctx(struct kioctx *ctx)
{ {
unsigned nr_events = ctx->max_reqs; unsigned nr_events = ctx->max_reqs;
if (unlikely(ctx->reqs_active)) BUG_ON(ctx->reqs_active);
BUG();
cancel_delayed_work(&ctx->wq); cancel_delayed_work(&ctx->wq);
flush_workqueue(aio_wq); flush_workqueue(aio_wq);
...@@ -505,8 +504,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) ...@@ -505,8 +504,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
assert_spin_locked(&ctx->ctx_lock); assert_spin_locked(&ctx->ctx_lock);
req->ki_users --; req->ki_users --;
if (unlikely(req->ki_users < 0)) BUG_ON(req->ki_users < 0);
BUG();
if (likely(req->ki_users)) if (likely(req->ki_users))
return 0; return 0;
list_del(&req->ki_list); /* remove from active_reqs */ list_del(&req->ki_list); /* remove from active_reqs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment