|
@@ -199,15 +199,7 @@ int sr_media_change(struct cdrom_device_info *cdi, int slot)
|
|
/* check multisession offset etc */
|
|
/* check multisession offset etc */
|
|
sr_cd_check(cdi);
|
|
sr_cd_check(cdi);
|
|
|
|
|
|
- /*
|
|
|
|
- * If the disk changed, the capacity will now be different,
|
|
|
|
- * so we force a re-read of this information
|
|
|
|
- * Force 2048 for the sector size so that filesystems won't
|
|
|
|
- * be trying to use something that is too small if the disc
|
|
|
|
- * has changed.
|
|
|
|
- */
|
|
|
|
- cd->needs_sector_size = 1;
|
|
|
|
- cd->device->sector_size = 2048;
|
|
|
|
|
|
+ get_sectorsize(cd);
|
|
}
|
|
}
|
|
return retval;
|
|
return retval;
|
|
}
|
|
}
|
|
@@ -538,13 +530,6 @@ static int sr_open(struct cdrom_device_info *cdi, int purpose)
|
|
if (!scsi_block_when_processing_errors(sdev))
|
|
if (!scsi_block_when_processing_errors(sdev))
|
|
goto error_out;
|
|
goto error_out;
|
|
|
|
|
|
- /*
|
|
|
|
- * If this device did not have media in the drive at boot time, then
|
|
|
|
- * we would have been unable to get the sector size. Check to see if
|
|
|
|
- * this is the case, and try again.
|
|
|
|
- */
|
|
|
|
- if (cd->needs_sector_size)
|
|
|
|
- get_sectorsize(cd);
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
error_out:
|
|
error_out:
|
|
@@ -604,7 +589,6 @@ static int sr_probe(struct device *dev)
|
|
cd->driver = &sr_template;
|
|
cd->driver = &sr_template;
|
|
cd->disk = disk;
|
|
cd->disk = disk;
|
|
cd->capacity = 0x1fffff;
|
|
cd->capacity = 0x1fffff;
|
|
- cd->needs_sector_size = 1;
|
|
|
|
cd->device->changed = 1; /* force recheck CD type */
|
|
cd->device->changed = 1; /* force recheck CD type */
|
|
cd->use = 1;
|
|
cd->use = 1;
|
|
cd->readcd_known = 0;
|
|
cd->readcd_known = 0;
|
|
@@ -694,7 +678,6 @@ static void get_sectorsize(struct scsi_cd *cd)
|
|
if (the_result) {
|
|
if (the_result) {
|
|
cd->capacity = 0x1fffff;
|
|
cd->capacity = 0x1fffff;
|
|
sector_size = 2048; /* A guess, just in case */
|
|
sector_size = 2048; /* A guess, just in case */
|
|
- cd->needs_sector_size = 1;
|
|
|
|
} else {
|
|
} else {
|
|
#if 0
|
|
#if 0
|
|
if (cdrom_get_last_written(&cd->cdi,
|
|
if (cdrom_get_last_written(&cd->cdi,
|
|
@@ -727,7 +710,6 @@ static void get_sectorsize(struct scsi_cd *cd)
|
|
printk("%s: unsupported sector size %d.\n",
|
|
printk("%s: unsupported sector size %d.\n",
|
|
cd->cdi.name, sector_size);
|
|
cd->cdi.name, sector_size);
|
|
cd->capacity = 0;
|
|
cd->capacity = 0;
|
|
- cd->needs_sector_size = 1;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
cd->device->sector_size = sector_size;
|
|
cd->device->sector_size = sector_size;
|
|
@@ -736,7 +718,6 @@ static void get_sectorsize(struct scsi_cd *cd)
|
|
* Add this so that we have the ability to correctly gauge
|
|
* Add this so that we have the ability to correctly gauge
|
|
* what the device is capable of.
|
|
* what the device is capable of.
|
|
*/
|
|
*/
|
|
- cd->needs_sector_size = 0;
|
|
|
|
set_capacity(cd->disk, cd->capacity);
|
|
set_capacity(cd->disk, cd->capacity);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -748,8 +729,7 @@ out:
|
|
|
|
|
|
Enomem:
|
|
Enomem:
|
|
cd->capacity = 0x1fffff;
|
|
cd->capacity = 0x1fffff;
|
|
- sector_size = 2048; /* A guess, just in case */
|
|
|
|
- cd->needs_sector_size = 1;
|
|
|
|
|
|
+ cd->device->sector_size = 2048; /* A guess, just in case */
|
|
if (SRpnt)
|
|
if (SRpnt)
|
|
scsi_release_request(SRpnt);
|
|
scsi_release_request(SRpnt);
|
|
goto out;
|
|
goto out;
|