Skip to content

Commit aa3d8a3

Browse files
neilbrownaxboe
authored andcommitted
block: change wait on bd_claiming to use a var_waitqueue
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>
1 parent 76c313f commit aa3d8a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/bdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ int bd_prepare_to_claim(struct block_device *bdev, void *holder,
548548

549549
/* if claiming is already in progress, wait for it to finish */
550550
if (whole->bd_claiming) {
551-
wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0);
551+
wait_queue_head_t *wq = __var_waitqueue(&whole->bd_claiming);
552552
DEFINE_WAIT(wait);
553553

554554
prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
@@ -571,7 +571,7 @@ static void bd_clear_claiming(struct block_device *whole, void *holder)
571571
/* tell others that we're done */
572572
BUG_ON(whole->bd_claiming != holder);
573573
whole->bd_claiming = NULL;
574-
wake_up_bit(&whole->bd_claiming, 0);
574+
wake_up_var(&whole->bd_claiming);
575575
}
576576

577577
/**

0 commit comments

Comments
 (0)