Skip to content

Commit

Permalink
blk-mq: Make bt_clear_tag() easier to read
Browse files Browse the repository at this point in the history
Eliminate a backwards goto statement from bt_clear_tag().

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Bart Van Assche authored and Jens Axboe committed Oct 7, 2014
1 parent abab13b commit 9d8f0bc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions block/blk-mq-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,12 @@ static void bt_clear_tag(struct blk_mq_bitmap_tags *bt, unsigned int tag)
return;

wait_cnt = atomic_dec_return(&bs->wait_cnt);
if (unlikely(wait_cnt < 0))
wait_cnt = atomic_inc_return(&bs->wait_cnt);
if (wait_cnt == 0) {
wake:
atomic_add(bt->wake_cnt, &bs->wait_cnt);
bt_index_atomic_inc(&bt->wake_index);
wake_up(&bs->wait);
} else if (wait_cnt < 0) {
wait_cnt = atomic_inc_return(&bs->wait_cnt);
if (!wait_cnt)
goto wake;
}
}

Expand Down

0 comments on commit 9d8f0bc

Please sign in to comment.