Lines Matching defs:whole
1041 * @whole: whole block device containing @bdev, may equal @bdev
1052 static bool bd_may_claim(struct block_device *bdev, struct block_device *whole,
1059 else if (whole == bdev)
1060 return true; /* is a whole device which isn't held */
1062 else if (whole->bd_holder == bd_may_claim)
1064 else if (whole->bd_holder != NULL)
1073 * @whole: the whole device containing @bdev, may equal @bdev
1083 int bd_prepare_to_claim(struct block_device *bdev, struct block_device *whole,
1089 if (!bd_may_claim(bdev, whole, holder)) {
1095 if (whole->bd_claiming) {
1096 wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0);
1107 whole->bd_claiming = holder;
1134 static void bd_clear_claiming(struct block_device *whole, void *holder)
1138 BUG_ON(whole->bd_claiming != holder);
1139 whole->bd_claiming = NULL;
1140 wake_up_bit(&whole->bd_claiming, 0);
1146 * @whole: whole block device
1153 struct block_device *whole, void *holder)
1156 BUG_ON(!bd_may_claim(bdev, whole, holder));
1158 * Note that for a whole device bd_holders will be incremented twice,
1161 whole->bd_holders++;
1162 whole->bd_holder = bd_may_claim;
1165 bd_clear_claiming(whole, holder);
1172 * @whole: whole block device
1179 void bd_abort_claiming(struct block_device *bdev, struct block_device *whole,
1183 bd_clear_claiming(whole, holder);
1464 * mutex_lock_nested(whole->bd_mutex, 1)
1470 struct block_device *whole = NULL, *claiming = NULL;
1484 whole = bdget_disk(disk, 0);
1485 if (!whole) {
1493 if (whole)
1494 claiming = whole;
1546 ret = __blkdev_get(whole, mode, NULL, 1);
1549 bdev->bd_contains = bdgrab(whole);
1600 if (whole)
1601 bdput(whole);
1617 if (whole)
1618 bdput(whole);