aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2014-10-07 10:45:21 -0400
committerJens Axboe <axboe@fb.com>2014-10-07 10:45:21 -0400
commit9d8f0bcca6ffa024a822ce4ab1008ab663f06672 (patch)
treea458e1fd409111a4afe142b7636ea3db5e413d04 /block
parentabab13b5c4fd1fec4f9a61622548012d93dc2831 (diff)
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.c7
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)
351 return; 351 return;
352 352
353 wait_cnt = atomic_dec_return(&bs->wait_cnt); 353 wait_cnt = atomic_dec_return(&bs->wait_cnt);
354 if (unlikely(wait_cnt < 0))
355 wait_cnt = atomic_inc_return(&bs->wait_cnt);
354 if (wait_cnt == 0) { 356 if (wait_cnt == 0) {
355wake:
356 atomic_add(bt->wake_cnt, &bs->wait_cnt); 357 atomic_add(bt->wake_cnt, &bs->wait_cnt);
357 bt_index_atomic_inc(&bt->wake_index); 358 bt_index_atomic_inc(&bt->wake_index);
358 wake_up(&bs->wait); 359 wake_up(&bs->wait);
359 } else if (wait_cnt < 0) {
360 wait_cnt = atomic_inc_return(&bs->wait_cnt);
361 if (!wait_cnt)
362 goto wake;
363 } 360 }
364} 361}
365 362