Lines Matching refs:disk
236 static void nd_blk_release_disk(void *disk) in nd_blk_release_disk() argument
238 del_gendisk(disk); in nd_blk_release_disk()
239 put_disk(disk); in nd_blk_release_disk()
247 struct gendisk *disk; in nsblk_attach_disk() local
263 disk = alloc_disk(0); in nsblk_attach_disk()
264 if (!disk) in nsblk_attach_disk()
267 disk->first_minor = 0; in nsblk_attach_disk()
268 disk->fops = &nd_blk_fops; in nsblk_attach_disk()
269 disk->queue = q; in nsblk_attach_disk()
270 disk->flags = GENHD_FL_EXT_DEVT; in nsblk_attach_disk()
271 disk->private_data = nsblk; in nsblk_attach_disk()
272 nvdimm_namespace_disk_name(&nsblk->common, disk->disk_name); in nsblk_attach_disk()
274 if (devm_add_action_or_reset(dev, nd_blk_release_disk, disk)) in nsblk_attach_disk()
278 int rc = nd_integrity_init(disk, nsblk_meta_size(nsblk)); in nsblk_attach_disk()
284 set_capacity(disk, available_disk_size >> SECTOR_SHIFT); in nsblk_attach_disk()
285 device_add_disk(dev, disk, NULL); in nsblk_attach_disk()
286 nvdimm_check_and_set_ro(disk); in nsblk_attach_disk()