diff options
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3fcb64b91c43..70c4dd99bbf0 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -383,9 +383,9 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
383 | struct scsi_device *sdp = q->queuedata; | 383 | struct scsi_device *sdp = q->queuedata; |
384 | struct gendisk *disk = rq->rq_disk; | 384 | struct gendisk *disk = rq->rq_disk; |
385 | struct scsi_disk *sdkp; | 385 | struct scsi_disk *sdkp; |
386 | sector_t block = rq->sector; | 386 | sector_t block = blk_rq_pos(rq); |
387 | sector_t threshold; | 387 | sector_t threshold; |
388 | unsigned int this_count = rq->nr_sectors; | 388 | unsigned int this_count = blk_rq_sectors(rq); |
389 | int ret, host_dif; | 389 | int ret, host_dif; |
390 | 390 | ||
391 | if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { | 391 | if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { |
@@ -412,10 +412,10 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
412 | this_count)); | 412 | this_count)); |
413 | 413 | ||
414 | if (!sdp || !scsi_device_online(sdp) || | 414 | if (!sdp || !scsi_device_online(sdp) || |
415 | block + rq->nr_sectors > get_capacity(disk)) { | 415 | block + blk_rq_sectors(rq) > get_capacity(disk)) { |
416 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, | 416 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, |
417 | "Finishing %ld sectors\n", | 417 | "Finishing %u sectors\n", |
418 | rq->nr_sectors)); | 418 | blk_rq_sectors(rq))); |
419 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, | 419 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, |
420 | "Retry with 0x%p\n", SCpnt)); | 420 | "Retry with 0x%p\n", SCpnt)); |
421 | goto out; | 421 | goto out; |
@@ -462,7 +462,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
462 | * for this. | 462 | * for this. |
463 | */ | 463 | */ |
464 | if (sdp->sector_size == 1024) { | 464 | if (sdp->sector_size == 1024) { |
465 | if ((block & 1) || (rq->nr_sectors & 1)) { | 465 | if ((block & 1) || (blk_rq_sectors(rq) & 1)) { |
466 | scmd_printk(KERN_ERR, SCpnt, | 466 | scmd_printk(KERN_ERR, SCpnt, |
467 | "Bad block number requested\n"); | 467 | "Bad block number requested\n"); |
468 | goto out; | 468 | goto out; |
@@ -472,7 +472,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
472 | } | 472 | } |
473 | } | 473 | } |
474 | if (sdp->sector_size == 2048) { | 474 | if (sdp->sector_size == 2048) { |
475 | if ((block & 3) || (rq->nr_sectors & 3)) { | 475 | if ((block & 3) || (blk_rq_sectors(rq) & 3)) { |
476 | scmd_printk(KERN_ERR, SCpnt, | 476 | scmd_printk(KERN_ERR, SCpnt, |
477 | "Bad block number requested\n"); | 477 | "Bad block number requested\n"); |
478 | goto out; | 478 | goto out; |
@@ -482,7 +482,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
482 | } | 482 | } |
483 | } | 483 | } |
484 | if (sdp->sector_size == 4096) { | 484 | if (sdp->sector_size == 4096) { |
485 | if ((block & 7) || (rq->nr_sectors & 7)) { | 485 | if ((block & 7) || (blk_rq_sectors(rq) & 7)) { |
486 | scmd_printk(KERN_ERR, SCpnt, | 486 | scmd_printk(KERN_ERR, SCpnt, |
487 | "Bad block number requested\n"); | 487 | "Bad block number requested\n"); |
488 | goto out; | 488 | goto out; |
@@ -511,10 +511,10 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
511 | } | 511 | } |
512 | 512 | ||
513 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, | 513 | SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, |
514 | "%s %d/%ld 512 byte blocks.\n", | 514 | "%s %d/%u 512 byte blocks.\n", |
515 | (rq_data_dir(rq) == WRITE) ? | 515 | (rq_data_dir(rq) == WRITE) ? |
516 | "writing" : "reading", this_count, | 516 | "writing" : "reading", this_count, |
517 | rq->nr_sectors)); | 517 | blk_rq_sectors(rq))); |
518 | 518 | ||
519 | /* Set RDPROTECT/WRPROTECT if disk is formatted with DIF */ | 519 | /* Set RDPROTECT/WRPROTECT if disk is formatted with DIF */ |
520 | host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type); | 520 | host_dif = scsi_host_dif_capable(sdp->host, sdkp->protection_type); |
@@ -970,8 +970,8 @@ static struct block_device_operations sd_fops = { | |||
970 | 970 | ||
971 | static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd) | 971 | static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd) |
972 | { | 972 | { |
973 | u64 start_lba = scmd->request->sector; | 973 | u64 start_lba = blk_rq_pos(scmd->request); |
974 | u64 end_lba = scmd->request->sector + (scsi_bufflen(scmd) / 512); | 974 | u64 end_lba = blk_rq_pos(scmd->request) + (scsi_bufflen(scmd) / 512); |
975 | u64 bad_lba; | 975 | u64 bad_lba; |
976 | int info_valid; | 976 | int info_valid; |
977 | 977 | ||