diff options
author | Bart Van Assche <bvanassche@acm.org> | 2014-10-07 18:45:21 +0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-10-07 18:45:21 +0400 |
commit | 9d8f0bcca6ffa024a822ce4ab1008ab663f06672 (patch) | |
tree | a458e1fd409111a4afe142b7636ea3db5e413d04 /block | |
parent | abab13b5c4fd1fec4f9a61622548012d93dc2831 (diff) | |
download | linux-9d8f0bcca6ffa024a822ce4ab1008ab663f06672.tar.xz |
blk-mq: Make bt_clear_tag() easier to read
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq-tag.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 146fd02659ec..8317175a3009 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -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; } } |