/* sd_ref_mutex must be held entering this routine. Because it is called on last put, you should always use the scsi_disk_get() scsi_disk_put() helpers which manipulate the semaphore directly and never do a direct put_device.  */
static void scsi_disk_release(struct device *cdev)
/* sd_ref_mutex must be held entering this routine. Because it is called on last put, you should always use the scsi_disk_get() scsi_disk_put() helpers which manipulate the semaphore directly and never do a direct put_device.  */
static void scsi_disk_release(struct device *cdev)
{
	struct scsi_disk *sdkp = to_scsi_disk(dev);
	struct gendisk *disk = sdkp->disk;
	spin_lock(&sd_index_lock);
	ida_remove(&sd_index_ida, sdkp->index);
	spin_unlock(&sd_index_lock);
	disk->private_data = NULL;
	put_disk(disk);
	put_device(&sdkp->device->sdev_gendev);
	kfree(sdkp);
}