Lines Matching refs:gd
113 struct gendisk *gd; member
368 struct gendisk *gd = info->gd; in blkif_ioctl() local
369 if (gd->flags & GENHD_FL_CD) in blkif_ioctl()
641 static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size, in xlvbd_init_blk_queue() argument
646 struct blkfront_info *info = gd->private_data; in xlvbd_init_blk_queue()
656 blk_queue_max_discard_sectors(rq, get_capacity(gd)); in xlvbd_init_blk_queue()
681 gd->queue = rq; in xlvbd_init_blk_queue()
691 info->gd->disk_name, in xlvbd_flush()
775 struct gendisk *gd; in xlvbd_alloc_gendisk() local
783 BUG_ON(info->gd != NULL); in xlvbd_alloc_gendisk()
820 gd = alloc_disk(nr_minors); in xlvbd_alloc_gendisk()
821 if (gd == NULL) in xlvbd_alloc_gendisk()
824 strcpy(gd->disk_name, DEV_NAME); in xlvbd_alloc_gendisk()
825 ptr = encode_disk_name(gd->disk_name + sizeof(DEV_NAME) - 1, offset); in xlvbd_alloc_gendisk()
826 BUG_ON(ptr >= gd->disk_name + DISK_NAME_LEN); in xlvbd_alloc_gendisk()
830 snprintf(ptr, gd->disk_name + DISK_NAME_LEN - ptr, in xlvbd_alloc_gendisk()
833 gd->major = XENVBD_MAJOR; in xlvbd_alloc_gendisk()
834 gd->first_minor = minor; in xlvbd_alloc_gendisk()
835 gd->fops = &xlvbd_block_fops; in xlvbd_alloc_gendisk()
836 gd->private_data = info; in xlvbd_alloc_gendisk()
837 gd->driverfs_dev = &(info->xbdev->dev); in xlvbd_alloc_gendisk()
838 set_capacity(gd, capacity); in xlvbd_alloc_gendisk()
840 if (xlvbd_init_blk_queue(gd, sector_size, physical_sector_size, in xlvbd_alloc_gendisk()
843 del_gendisk(gd); in xlvbd_alloc_gendisk()
847 info->rq = gd->queue; in xlvbd_alloc_gendisk()
848 info->gd = gd; in xlvbd_alloc_gendisk()
853 set_disk_ro(gd, 1); in xlvbd_alloc_gendisk()
856 gd->flags |= GENHD_FL_REMOVABLE; in xlvbd_alloc_gendisk()
859 gd->flags |= GENHD_FL_CD; in xlvbd_alloc_gendisk()
889 del_gendisk(info->gd); in xlvbd_release_gendisk()
891 minor = info->gd->first_minor; in xlvbd_release_gendisk()
892 nr_minors = info->gd->minors; in xlvbd_release_gendisk()
898 put_disk(info->gd); in xlvbd_release_gendisk()
899 info->gd = NULL; in xlvbd_release_gendisk()
1145 info->gd->disk_name, op_name(bret->operation), id); in blkif_interrupt()
1157 info->gd->disk_name, op_name(bret->operation), id); in blkif_interrupt()
1167 info->gd->disk_name, op_name(bret->operation)); in blkif_interrupt()
1180 info->gd->disk_name, op_name(bret->operation)); in blkif_interrupt()
1186 info->gd->disk_name, op_name(bret->operation)); in blkif_interrupt()
1618 if (info->gd) in blkfront_closing()
1619 bdev = bdget_disk(info->gd, 0); in blkfront_closing()
1769 set_capacity(info->gd, sectors); in blkfront_connect()
1770 revalidate_disk(info->gd); in blkfront_connect()
1881 add_disk(info->gd); in blkfront_connect()
1932 disk = info->gd; in blkfront_remove()
1993 if (!info->gd) in blkif_open()