diff options
author | James Bottomley <jejb@titanic.(none)> | 2005-08-28 12:40:00 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-08-28 12:40:00 -0400 |
commit | ba482ef4b16bad5172d2be693d4b2420b84c84e7 (patch) | |
tree | 8da2f7f2e223a4ba4c64ef30daa7a2c6154f85d7 /drivers/scsi | |
parent | e514385be2b355c1f3fc6385a98a6a0fc04235ae (diff) | |
parent | 51490c89f95b8581782e9baa855da166441852be (diff) |
Merge by hand (conflicts in sr.c)
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/sr.c | 24 | ||||
-rw-r--r-- | drivers/scsi/sr.h | 1 |
2 files changed, 2 insertions, 23 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 39fc5b0fbc18..ce63fc8312dc 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -199,15 +199,7 @@ int sr_media_change(struct cdrom_device_info *cdi, int slot) | |||
199 | /* check multisession offset etc */ | 199 | /* check multisession offset etc */ |
200 | sr_cd_check(cdi); | 200 | sr_cd_check(cdi); |
201 | 201 | ||
202 | /* | 202 | get_sectorsize(cd); |
203 | * If the disk changed, the capacity will now be different, | ||
204 | * so we force a re-read of this information | ||
205 | * Force 2048 for the sector size so that filesystems won't | ||
206 | * be trying to use something that is too small if the disc | ||
207 | * has changed. | ||
208 | */ | ||
209 | cd->needs_sector_size = 1; | ||
210 | cd->device->sector_size = 2048; | ||
211 | } | 203 | } |
212 | return retval; | 204 | return retval; |
213 | } | 205 | } |
@@ -538,13 +530,6 @@ static int sr_open(struct cdrom_device_info *cdi, int purpose) | |||
538 | if (!scsi_block_when_processing_errors(sdev)) | 530 | if (!scsi_block_when_processing_errors(sdev)) |
539 | goto error_out; | 531 | goto error_out; |
540 | 532 | ||
541 | /* | ||
542 | * If this device did not have media in the drive at boot time, then | ||
543 | * we would have been unable to get the sector size. Check to see if | ||
544 | * this is the case, and try again. | ||
545 | */ | ||
546 | if (cd->needs_sector_size) | ||
547 | get_sectorsize(cd); | ||
548 | return 0; | 533 | return 0; |
549 | 534 | ||
550 | error_out: | 535 | error_out: |
@@ -604,7 +589,6 @@ static int sr_probe(struct device *dev) | |||
604 | cd->driver = &sr_template; | 589 | cd->driver = &sr_template; |
605 | cd->disk = disk; | 590 | cd->disk = disk; |
606 | cd->capacity = 0x1fffff; | 591 | cd->capacity = 0x1fffff; |
607 | cd->needs_sector_size = 1; | ||
608 | cd->device->changed = 1; /* force recheck CD type */ | 592 | cd->device->changed = 1; /* force recheck CD type */ |
609 | cd->use = 1; | 593 | cd->use = 1; |
610 | cd->readcd_known = 0; | 594 | cd->readcd_known = 0; |
@@ -682,7 +666,6 @@ static void get_sectorsize(struct scsi_cd *cd) | |||
682 | if (the_result) { | 666 | if (the_result) { |
683 | cd->capacity = 0x1fffff; | 667 | cd->capacity = 0x1fffff; |
684 | sector_size = 2048; /* A guess, just in case */ | 668 | sector_size = 2048; /* A guess, just in case */ |
685 | cd->needs_sector_size = 1; | ||
686 | } else { | 669 | } else { |
687 | #if 0 | 670 | #if 0 |
688 | if (cdrom_get_last_written(&cd->cdi, | 671 | if (cdrom_get_last_written(&cd->cdi, |
@@ -715,7 +698,6 @@ static void get_sectorsize(struct scsi_cd *cd) | |||
715 | printk("%s: unsupported sector size %d.\n", | 698 | printk("%s: unsupported sector size %d.\n", |
716 | cd->cdi.name, sector_size); | 699 | cd->cdi.name, sector_size); |
717 | cd->capacity = 0; | 700 | cd->capacity = 0; |
718 | cd->needs_sector_size = 1; | ||
719 | } | 701 | } |
720 | 702 | ||
721 | cd->device->sector_size = sector_size; | 703 | cd->device->sector_size = sector_size; |
@@ -724,7 +706,6 @@ static void get_sectorsize(struct scsi_cd *cd) | |||
724 | * Add this so that we have the ability to correctly gauge | 706 | * Add this so that we have the ability to correctly gauge |
725 | * what the device is capable of. | 707 | * what the device is capable of. |
726 | */ | 708 | */ |
727 | cd->needs_sector_size = 0; | ||
728 | set_capacity(cd->disk, cd->capacity); | 709 | set_capacity(cd->disk, cd->capacity); |
729 | } | 710 | } |
730 | 711 | ||
@@ -736,8 +717,7 @@ out: | |||
736 | 717 | ||
737 | Enomem: | 718 | Enomem: |
738 | cd->capacity = 0x1fffff; | 719 | cd->capacity = 0x1fffff; |
739 | sector_size = 2048; /* A guess, just in case */ | 720 | cd->device->sector_size = 2048; /* A guess, just in case */ |
740 | cd->needs_sector_size = 1; | ||
741 | goto out; | 721 | goto out; |
742 | } | 722 | } |
743 | 723 | ||
diff --git a/drivers/scsi/sr.h b/drivers/scsi/sr.h index 0b3178007203..d2bcd99c272f 100644 --- a/drivers/scsi/sr.h +++ b/drivers/scsi/sr.h | |||
@@ -33,7 +33,6 @@ typedef struct scsi_cd { | |||
33 | struct scsi_device *device; | 33 | struct scsi_device *device; |
34 | unsigned int vendor; /* vendor code, see sr_vendor.c */ | 34 | unsigned int vendor; /* vendor code, see sr_vendor.c */ |
35 | unsigned long ms_offset; /* for reading multisession-CD's */ | 35 | unsigned long ms_offset; /* for reading multisession-CD's */ |
36 | unsigned needs_sector_size:1; /* needs to get sector size */ | ||
37 | unsigned use:1; /* is this device still supportable */ | 36 | unsigned use:1; /* is this device still supportable */ |
38 | unsigned xa_flag:1; /* CD has XA sectors ? */ | 37 | unsigned xa_flag:1; /* CD has XA sectors ? */ |
39 | unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */ | 38 | unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */ |