]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
block: change wait on bd_claiming to use a var_waitqueue
authorNeilBrown <neilb@suse.de>
Mon, 26 Aug 2024 06:30:58 +0000 (16:30 +1000)
committerJens Axboe <axboe@kernel.dk>
Tue, 17 Sep 2024 03:12:33 +0000 (21:12 -0600)
bd_prepare_to_claim() waits for a var to change, not for a bit to be
cleared. Change from bit_waitqueue() to __var_waitqueue() and
correspondingly use wake_up_var(). This will allow a future patch which
change the "bit" function to expect an "unsigned long *" instead of
"void *".

Signed-off-by: NeilBrown <neilb@suse.de>
Link: https://lore.kernel.org/r/20240826063659.15327-2-neilb@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bdev.c

index c5507b6f63b8b13a2a978b9235ccdea9e3a9395b..21e688fb64496ec495ab6ff3d8fe63f37ed92084 100644 (file)
@@ -548,7 +548,7 @@ retry:
 
        /* if claiming is already in progress, wait for it to finish */
        if (whole->bd_claiming) {
-               wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0);
+               wait_queue_head_t *wq = __var_waitqueue(&whole->bd_claiming);
                DEFINE_WAIT(wait);
 
                prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
@@ -571,7 +571,7 @@ static void bd_clear_claiming(struct block_device *whole, void *holder)
        /* tell others that we're done */
        BUG_ON(whole->bd_claiming != holder);
        whole->bd_claiming = NULL;
-       wake_up_bit(&whole->bd_claiming, 0);
+       wake_up_var(&whole->bd_claiming);
 }
 
 /**