summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 280cda345..bcdc4aab3 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -338,6 +338,15 @@ static int sd_init_command(Scsi_Cmnd * SCpnt)
this_count = this_count >> 2;
}
}
+ if (dpnt->device->sector_size == 4096) {
+ if ((block & 7) || (SCpnt->request.nr_sectors & 7)) {
+ printk("sd.c:Bad block number requested");
+ return 0;
+ } else {
+ block = block >> 3;
+ this_count = this_count >> 3;
+ }
+ }
switch (SCpnt->request.cmd) {
case WRITE:
if (!dpnt->device->writeable) {
@@ -588,6 +597,11 @@ static void rw_intr(Scsi_Cmnd * SCpnt)
if (block_sectors < 4)
block_sectors = 4;
break;
+ case 4096:
+ error_sector <<=3;
+ if (block_sectors < 8)
+ block_sectors = 8;
+ break;
case 256:
error_sector >>= 1;
break;
@@ -889,7 +903,7 @@ static int sd_init_onedisk(int i)
*/
rscsi_disks[i].capacity = 0;
}
- if (sector_size == 2048) {
+ if (sector_size > 1024) {
int m;
/*
@@ -899,7 +913,7 @@ static int sd_init_onedisk(int i)
* of partial sectors.
*/
for (m = i << 4; m < ((i + 1) << 4); m++) {
- sd_blocksizes[m] = 2048;
+ sd_blocksizes[m] = sector_size;
}
} {
/*