diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-12 11:02:03 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-12 11:02:03 -0400 |
commit | 82681a318f9f028ea64e61f24bbd9ac535531921 (patch) | |
tree | 529b6a5b4fd040fb54b7672b1a224ebd47445876 /drivers/scsi/sd.c | |
parent | 3860c97bd60a4525bb62eb90e3e7d2f02662ac59 (diff) | |
parent | 8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff) |
[SCSI] Merge branch 'linus'
Conflicts:
drivers/message/fusion/mptsas.c
fixed up conflict between req->data_len accessors and mptsas driver updates.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d8e1d15101b7..878b17a9af30 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -384,9 +384,9 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
384 | struct scsi_device *sdp = q->queuedata; | 384 | struct scsi_device *sdp = q->queuedata; |
385 | struct gendisk *disk = rq->rq_disk; | 385 | struct gendisk *disk = rq->rq_disk; |
386 | struct scsi_disk *sdkp; | 386 | struct scsi_disk *sdkp; |
387 | sector_t block = rq->sector; | 387 | sector_t block = blk_rq_pos(rq); |
388 | sector_t threshold; | 388 | sector_t threshold; |
389 | unsigned int this_count = rq->nr_sectors; | 389 | unsigned int this_count = blk_rq_sectors(rq); |
390 | int ret, host_dif; | 390 | int ret, host_dif; |
391 | 391 | ||
392 | if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { | 392 | if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { |
@@ -413,10 +413,10 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
413 | this_count)); | 413 | this_count)); |
414 | 414 | ||
415 | if (!sdp || !scsi_device_online(sdp) || | 415 | if (!sdp || !scsi_device_online(sdp) || |
416 | block + rq->nr_sectors > get_capacity(disk)) { | 416 | block + blk_rq_sectors(rq) > get_capacity(disk)) { |
417 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, | 417 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, |
418 | "Finishing %ld sectors\n", | 418 | "Finishing %u sectors\n", |
419 | rq->nr_sectors)); | 419 | blk_rq_sectors(rq))); |
420 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, | 420 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, |
421 | "Retry with 0x%p\n", SCpnt)); | 421 | "Retry with 0x%p\n", SCpnt)); |
422 | goto out; | 422 | goto out; |
@@ -463,7 +463,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
463 | * for this. | 463 | * for this. |
464 | */ | 464 | */ |
465 | if (sdp->sector_size == 1024) { | 465 | if (sdp->sector_size == 1024) { |
466 | if ((block & 1) || (rq->nr_sectors & 1)) { | 466 | if ((block & 1) || (blk_rq_sectors(rq) & 1)) { |
467 | scmd_printk(KERN_ERR, SCpnt, | 467 | scmd_printk(KERN_ERR, SCpnt, |
468 | "Bad block number requested\n"); | 468 | "Bad block number requested\n"); |
469 | goto out; | 469 | goto out; |
@@ -473,7 +473,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
473 | } | 473 | } |
474 | } | 474 | } |
475 | if (sdp->sector_size == 2048) { | 475 | if (sdp->sector_size == 2048) { |
476 | if ((block & 3) || (rq->nr_sectors & 3)) { | 476 | if ((block & 3) || (blk_rq_sectors(rq) & 3)) { |
477 | scmd_printk(KERN_ERR, SCpnt, | 477 | scmd_printk(KERN_ERR, SCpnt, |
478 | "Bad block number requested\n"); | 478 | "Bad block number requested\n"); |
479 | goto out; | 479 | goto out; |
@@ -483,7 +483,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
483 | } | 483 | } |
484 | } | 484 | } |
485 | if (sdp->sector_size == 4096) { | 485 | if (sdp->sector_size == 4096) { |
486 | if ((block & 7) || (rq->nr_sectors & 7)) { | 486 | if ((block & 7) || (blk_rq_sectors(rq) & 7)) { |
487 | scmd_printk(KERN_ERR, SCpnt, | 487 | scmd_printk(KERN_ERR, SCpnt, |
488 | "Bad block number requested\n"); | 488 | "Bad block number requested\n"); |
489 | goto out; | 489 | goto out; |
@@ -512,10 +512,10 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
512 | } | 512 | } |
513 | 513 | ||
514 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, | 514 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, |
515 | "%s %d/%ld 512 byte blocks.\n", | 515 | "%s %d/%u 512 byte blocks.\n", |
516 | (rq_data_dir(rq) == WRITE) ? | 516 | (rq_data_dir(rq) == WRITE) ? |
517 | "writing" : "reading", this_count, | 517 | "writing" : "reading", this_count, |
518 | rq->nr_sectors)); | 518 | blk_rq_sectors(rq))); |
519 | 519 | ||
520 | /* Set RDPROTECT/WRPROTECT if disk is formatted with DIF */ | 520 | /* Set RDPROTECT/WRPROTECT if disk is formatted with DIF */ |
521 | host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type); | 521 | host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type); |
@@ -971,8 +971,8 @@ static struct block_device_operations sd_fops = { | |||
971 | 971 | ||
972 | static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd) | 972 | static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd) |
973 | { | 973 | { |
974 | u64 start_lba = scmd->request->sector; | 974 | u64 start_lba = blk_rq_pos(scmd->request); |
975 | u64 end_lba = scmd->request->sector + (scsi_bufflen(scmd) / 512); | 975 | u64 end_lba = blk_rq_pos(scmd->request) + (scsi_bufflen(scmd) / 512); |
976 | u64 bad_lba; | 976 | u64 bad_lba; |
977 | int info_valid; | 977 | int info_valid; |
978 | 978 | ||
@@ -1510,7 +1510,7 @@ got_data: | |||
1510 | */ | 1510 | */ |
1511 | sector_size = 512; | 1511 | sector_size = 512; |
1512 | } | 1512 | } |
1513 | blk_queue_hardsect_size(sdp->request_queue, sector_size); | 1513 | blk_queue_logical_block_size(sdp->request_queue, sector_size); |
1514 | 1514 | ||
1515 | { | 1515 | { |
1516 | char cap_str_2[10], cap_str_10[10]; | 1516 | char cap_str_2[10], cap_str_10[10]; |