Lines Matching full:whole
532 * @whole: whole block device containing @bdev, may equal @bdev
543 static bool bd_may_claim(struct block_device *bdev, struct block_device *whole, in bd_may_claim() argument
550 else if (whole == bdev) in bd_may_claim()
551 return true; /* is a whole device which isn't held */ in bd_may_claim()
553 else if (whole->bd_holder == bd_may_claim) in bd_may_claim()
555 else if (whole->bd_holder != NULL) in bd_may_claim()
575 struct block_device *whole = bdev_whole(bdev); in bd_prepare_to_claim() local
582 if (!bd_may_claim(bdev, whole, holder)) { in bd_prepare_to_claim()
588 if (whole->bd_claiming) { in bd_prepare_to_claim()
589 wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0); in bd_prepare_to_claim()
600 whole->bd_claiming = holder; in bd_prepare_to_claim()
606 static void bd_clear_claiming(struct block_device *whole, void *holder) in bd_clear_claiming() argument
610 BUG_ON(whole->bd_claiming != holder); in bd_clear_claiming()
611 whole->bd_claiming = NULL; in bd_clear_claiming()
612 wake_up_bit(&whole->bd_claiming, 0); in bd_clear_claiming()
625 struct block_device *whole = bdev_whole(bdev); in bd_finish_claiming() local
628 BUG_ON(!bd_may_claim(bdev, whole, holder)); in bd_finish_claiming()
630 * Note that for a whole device bd_holders will be incremented twice, in bd_finish_claiming()
633 whole->bd_holders++; in bd_finish_claiming()
634 whole->bd_holder = bd_may_claim; in bd_finish_claiming()
637 bd_clear_claiming(whole, holder); in bd_finish_claiming()
727 struct block_device *whole = bdev_whole(part); in blkdev_put_part() local
732 whole->bd_disk->open_partitions--; in blkdev_put_part()
733 blkdev_put_whole(whole, mode); in blkdev_put_part()
913 struct block_device *whole = bdev_whole(bdev); in blkdev_put() local
924 WARN_ON_ONCE(--whole->bd_holders < 0); in blkdev_put()
928 if (!whole->bd_holders) in blkdev_put()
929 whole->bd_holder = NULL; in blkdev_put()