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()
302 struct scsi_cd *cd = scsi_cd(rq->q->disk); in sr_done()
342 if (error_sector < get_capacity(cd->disk) && in sr_done()
344 set_capacity(cd->disk, error_sector); in sr_done()
369 cd = scsi_cd(rq->q->disk); in sr_init_command()
487 static int sr_block_open(struct gendisk *disk, blk_mode_t mode) in sr_block_open() argument
489 struct scsi_cd *cd = scsi_cd(disk); in sr_block_open()
497 if (disk_check_media_change(disk)) in sr_block_open()
510 static void sr_block_release(struct gendisk *disk) in sr_block_release() argument
512 struct scsi_cd *cd = scsi_cd(disk); in sr_block_release()
555 static unsigned int sr_block_check_events(struct gendisk *disk, in sr_block_check_events() argument
558 struct scsi_cd *cd = disk->private_data; in sr_block_check_events()
565 static void sr_free_disk(struct gendisk *disk) in sr_free_disk() argument
567 struct scsi_cd *cd = disk->private_data; in sr_free_disk()
570 clear_bit(MINOR(disk_devt(disk)), sr_index_bits); in sr_free_disk()
611 struct gendisk *disk; in sr_probe() local
625 disk = blk_mq_alloc_disk_for_queue(sdev->request_queue, in sr_probe()
627 if (!disk) in sr_probe()
641 disk->major = SCSI_CDROM_MAJOR; in sr_probe()
642 disk->first_minor = minor; in sr_probe()
643 disk->minors = 1; in sr_probe()
644 sprintf(disk->disk_name, "sr%d", minor); in sr_probe()
645 disk->fops = &sr_bdops; in sr_probe()
646 disk->flags |= GENHD_FL_REMOVABLE | GENHD_FL_NO_PART; in sr_probe()
647 disk->events = DISK_EVENT_MEDIA_CHANGE | DISK_EVENT_EJECT_REQUEST; in sr_probe()
648 disk->event_flags = DISK_EVENT_FLAG_POLL | DISK_EVENT_FLAG_UEVENT | in sr_probe()
654 cd->disk = disk; in sr_probe()
675 set_capacity(disk, cd->capacity); in sr_probe()
676 disk->private_data = cd; in sr_probe()
678 if (register_cdrom(disk, &cd->cdi)) in sr_probe()
690 error = device_add_disk(&sdev->sdev_gendev, disk, NULL); in sr_probe()
707 put_disk(disk); in sr_probe()
787 set_capacity(cd->disk, cd->capacity); in get_sectorsize()
927 struct gendisk *disk = cdi->disk; in sr_read_cdda_bpc() local
934 rq = scsi_alloc_request(disk->queue, REQ_OP_DRV_IN, 0); in sr_read_cdda_bpc()
939 ret = blk_rq_map_user(disk->queue, rq, NULL, ubuf, len, GFP_KERNEL); in sr_read_cdda_bpc()
980 del_gendisk(cd->disk); in sr_remove()
981 put_disk(cd->disk); in sr_remove()