path: root/block
diff options
authorBart Van Assche <bart.vanassche@wdc.com>2018-01-10 11:34:27 -0800
committerJens Axboe <axboe@kernel.dk>2018-01-10 12:36:02 -0700
commitb7435db8b8d11df94453708295c2ea5b09caff5f (patch)
treed86bd3372a7b0b57acaf34da373a29d8ac71f642 /block
parent0478fe68685a428c71decc19abecd265a6d658dd (diff)
blk-mq: Add locking annotations to hctx_lock() and hctx_unlock()
This patch avoids that sparse reports the following: block/blk-mq.c:637:33: warning: context imbalance in 'hctx_unlock' - unexpected unlock block/blk-mq.c:642:9: warning: context imbalance in 'hctx_lock' - wrong count at exit Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 435a5a0d441f..8000ba6db07d 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -559,6 +559,7 @@ static void __blk_mq_complete_request(struct request *rq)
static void hctx_unlock(struct blk_mq_hw_ctx *hctx, int srcu_idx)
+ __releases(hctx->srcu)
if (!(hctx->flags & BLK_MQ_F_BLOCKING))
@@ -567,6 +568,7 @@ static void hctx_unlock(struct blk_mq_hw_ctx *hctx, int srcu_idx)
static void hctx_lock(struct blk_mq_hw_ctx *hctx, int *srcu_idx)
+ __acquires(hctx->srcu)
if (!(hctx->flags & BLK_MQ_F_BLOCKING)) {
/* shut up gcc false positive */

Privacy Policy