[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1496331795.394937218@decadent.org.uk>
Date: Thu, 01 Jun 2017 16:43:15 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Jens Axboe" <axboe@...com>,
"Bart Van Assche" <bvanassche@....org>
Subject: [PATCH 3.16 056/212] blk-mq: Make bt_clear_tag() easier to read
3.16.44-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <bvanassche@....org>
commit 9d8f0bcca6ffa024a822ce4ab1008ab663f06672 upstream.
Eliminate a backwards goto statement from bt_clear_tag().
Signed-off-by: Bart Van Assche <bvanassche@....org>
Signed-off-by: Jens Axboe <axboe@...com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
block/blk-mq-tag.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -352,15 +352,12 @@ static void bt_clear_tag(struct blk_mq_b
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;
}
}
Powered by blists - more mailing lists