null_blk: add lock drop/acquire annotation
authorJens Axboe <axboe@kernel.dk>
Thu, 9 Aug 2018 20:22:41 +0000 (14:22 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 9 Aug 2018 20:22:41 +0000 (14:22 -0600)
sparse complains:

drivers/block/null_blk_main.c:816:24: sparse: context imbalance in 'null_insert_page' - unexpected unlock

Fix it by adding the necessary annotations to the function.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk_main.c

index 86cafa6..6127e3f 100644 (file)
@@ -804,7 +804,9 @@ static struct nullb_page *null_lookup_page(struct nullb *nullb,
 }
 
 static struct nullb_page *null_insert_page(struct nullb *nullb,
-       sector_t sector, bool ignore_cache)
+                                          sector_t sector, bool ignore_cache)
+       __releases(&nullb->lock)
+       __acquires(&nullb->lock)
 {
        u64 idx;
        struct nullb_page *t_page;