/* The get and put routines for the struct scsi_cd. Note this entity has a scsi_device pointer and owns a reference to this.  */
static struct scsi_cd* scsi_cd_get(struct gendisk *disk)
/* The get and put routines for the struct scsi_cd. Note this entity has a scsi_device pointer and owns a reference to this.  */
static struct scsi_cd* scsi_cd_get(struct gendisk *disk)
{
	struct scsi_cd *cd = NULL;
	mutex_lock(&sr_ref_mutex);
	if (disk->private_data == NULL)
		goto out;
	cd = scsi_cd(disk);
	kref_get(&cd->kref);
	if (scsi_device_get(cd->device))
		goto out_put;
	goto out;
 out_put:
	kref_put(&cd->kref, sr_kref_release);
	cd = NULL;
 out:
	mutex_unlock(&sr_ref_mutex);
	return cd;
}