Lines Matching refs:disk

141 static inline struct scsi_cd *scsi_cd(struct gendisk *disk)  in scsi_cd()  argument
143 return disk->private_data; in scsi_cd()
299 struct scsi_cd *cd = scsi_cd(rq->q->disk); in sr_done()
339 if (error_sector < get_capacity(cd->disk) && in sr_done()
341 set_capacity(cd->disk, error_sector); in sr_done()
366 cd = scsi_cd(rq->q->disk); in sr_init_command()
507 static void sr_block_release(struct gendisk *disk, fmode_t mode) in sr_block_release() argument
509 struct scsi_cd *cd = scsi_cd(disk); in sr_block_release()
552 static unsigned int sr_block_check_events(struct gendisk *disk, in sr_block_check_events() argument
555 struct scsi_cd *cd = disk->private_data; in sr_block_check_events()
562 static void sr_free_disk(struct gendisk *disk) in sr_free_disk() argument
564 struct scsi_cd *cd = disk->private_data; in sr_free_disk()
567 clear_bit(MINOR(disk_devt(disk)), sr_index_bits); in sr_free_disk()
613 struct gendisk *disk; in sr_probe() local
627 disk = blk_mq_alloc_disk_for_queue(sdev->request_queue, in sr_probe()
629 if (!disk) in sr_probe()
643 disk->major = SCSI_CDROM_MAJOR; in sr_probe()
644 disk->first_minor = minor; in sr_probe()
645 disk->minors = 1; in sr_probe()
646 sprintf(disk->disk_name, "sr%d", minor); in sr_probe()
647 disk->fops = &sr_bdops; in sr_probe()
648 disk->flags |= GENHD_FL_REMOVABLE | GENHD_FL_NO_PART; in sr_probe()
649 disk->events = DISK_EVENT_MEDIA_CHANGE | DISK_EVENT_EJECT_REQUEST; in sr_probe()
650 disk->event_flags = DISK_EVENT_FLAG_POLL | DISK_EVENT_FLAG_UEVENT | in sr_probe()
656 cd->disk = disk; in sr_probe()
677 set_capacity(disk, cd->capacity); in sr_probe()
678 disk->private_data = cd; in sr_probe()
680 if (register_cdrom(disk, &cd->cdi)) in sr_probe()
692 error = device_add_disk(&sdev->sdev_gendev, disk, NULL); in sr_probe()
709 put_disk(disk); in sr_probe()
789 set_capacity(cd->disk, cd->capacity); in get_sectorsize()
929 struct gendisk *disk = cdi->disk; in sr_read_cdda_bpc() local
936 rq = scsi_alloc_request(disk->queue, REQ_OP_DRV_IN, 0); in sr_read_cdda_bpc()
941 ret = blk_rq_map_user(disk->queue, rq, NULL, ubuf, len, GFP_KERNEL); in sr_read_cdda_bpc()
982 del_gendisk(cd->disk); in sr_remove()
983 put_disk(cd->disk); in sr_remove()