Lines Matching refs:whole
1003 static bool bd_may_claim(struct block_device *bdev, struct block_device *whole, in bd_may_claim() argument
1010 else if (whole == bdev) in bd_may_claim()
1013 else if (whole->bd_holder == bd_may_claim) in bd_may_claim()
1015 else if (whole->bd_holder != NULL) in bd_may_claim()
1040 struct block_device *whole, void *holder) in bd_prepare_to_claim() argument
1044 if (!bd_may_claim(bdev, whole, holder)) in bd_prepare_to_claim()
1048 if (whole->bd_claiming) { in bd_prepare_to_claim()
1049 wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0); in bd_prepare_to_claim()
1112 struct block_device *whole; in bd_start_claiming() local
1134 whole = bdget_disk(disk, 0); in bd_start_claiming()
1136 whole = bdgrab(bdev); in bd_start_claiming()
1139 if (!whole) in bd_start_claiming()
1145 err = bd_prepare_to_claim(bdev, whole, holder); in bd_start_claiming()
1147 whole->bd_claiming = holder; in bd_start_claiming()
1149 return whole; in bd_start_claiming()
1152 bdput(whole); in bd_start_claiming()
1518 struct block_device *whole; in __blkdev_get() local
1519 whole = bdget_disk(disk, 0); in __blkdev_get()
1521 if (!whole) in __blkdev_get()
1524 ret = __blkdev_get(whole, mode, 1); in __blkdev_get()
1527 bdev->bd_contains = whole; in __blkdev_get()
1604 struct block_device *whole = NULL; in blkdev_get() local
1610 whole = bd_start_claiming(bdev, holder); in blkdev_get()
1611 if (IS_ERR(whole)) { in blkdev_get()
1613 return PTR_ERR(whole); in blkdev_get()
1619 if (whole) { in blkdev_get()
1620 struct gendisk *disk = whole->bd_disk; in blkdev_get()
1627 BUG_ON(!bd_may_claim(bdev, whole, holder)); in blkdev_get()
1634 whole->bd_holders++; in blkdev_get()
1635 whole->bd_holder = bd_may_claim; in blkdev_get()
1641 BUG_ON(whole->bd_claiming != holder); in blkdev_get()
1642 whole->bd_claiming = NULL; in blkdev_get()
1643 wake_up_bit(&whole->bd_claiming, 0); in blkdev_get()
1661 bdput(whole); in blkdev_get()