Lines Matching refs:gd
90 struct gendisk *gd; member
253 dev_err(disk_to_dev(dev->gd), "failed to open ubi volume %d_%d", in ubiblock_open()
270 static void ubiblock_release(struct gendisk *gd, fmode_t mode) in ubiblock_release() argument
272 struct ubiblock *dev = gd->private_data; in ubiblock_release()
361 struct gendisk *gd; in ubiblock_create() local
387 gd = alloc_disk(1); in ubiblock_create()
388 if (!gd) { in ubiblock_create()
394 gd->fops = &ubiblock_ops; in ubiblock_create()
395 gd->major = ubiblock_major; in ubiblock_create()
396 gd->first_minor = idr_alloc(&ubiblock_minor_idr, dev, 0, 0, GFP_KERNEL); in ubiblock_create()
397 if (gd->first_minor < 0) { in ubiblock_create()
398 dev_err(disk_to_dev(gd), in ubiblock_create()
403 gd->private_data = dev; in ubiblock_create()
404 sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id); in ubiblock_create()
405 set_capacity(gd, disk_capacity); in ubiblock_create()
406 dev->gd = gd; in ubiblock_create()
418 dev_err(disk_to_dev(dev->gd), "blk_mq_alloc_tag_set failed"); in ubiblock_create()
424 dev_err(disk_to_dev(gd), "blk_mq_init_queue failed"); in ubiblock_create()
431 dev->gd->queue = dev->rq; in ubiblock_create()
437 dev->wq = alloc_workqueue("%s", 0, 0, gd->disk_name); in ubiblock_create()
446 add_disk(dev->gd); in ubiblock_create()
447 dev_info(disk_to_dev(dev->gd), "created from ubi%d:%d(%s)", in ubiblock_create()
457 idr_remove(&ubiblock_minor_idr, gd->first_minor); in ubiblock_create()
459 put_disk(dev->gd); in ubiblock_create()
471 del_gendisk(dev->gd); in ubiblock_cleanup()
477 dev_info(disk_to_dev(dev->gd), "released"); in ubiblock_cleanup()
478 idr_remove(&ubiblock_minor_idr, dev->gd->first_minor); in ubiblock_cleanup()
479 put_disk(dev->gd); in ubiblock_cleanup()
535 dev_warn(disk_to_dev(dev->gd), "the volume is too big (%d LEBs), cannot resize", in ubiblock_resize()
542 if (get_capacity(dev->gd) != disk_capacity) { in ubiblock_resize()
543 set_capacity(dev->gd, disk_capacity); in ubiblock_resize()
544 dev_info(disk_to_dev(dev->gd), "resized to %lld bytes", in ubiblock_resize()