aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 8802e48bc063..a3fdf4dc59da 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -485,7 +485,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
485 * Discard request come in as REQ_TYPE_FS but we turn them into 485 * Discard request come in as REQ_TYPE_FS but we turn them into
486 * block PC requests to make life easier. 486 * block PC requests to make life easier.
487 */ 487 */
488 if (blk_discard_rq(rq)) 488 if (rq->cmd_flags & REQ_DISCARD)
489 ret = sd_prepare_discard(rq); 489 ret = sd_prepare_discard(rq);
490 490
491 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { 491 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
@@ -636,7 +636,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
636 SCpnt->cmnd[0] = VARIABLE_LENGTH_CMD; 636 SCpnt->cmnd[0] = VARIABLE_LENGTH_CMD;
637 SCpnt->cmnd[7] = 0x18; 637 SCpnt->cmnd[7] = 0x18;
638 SCpnt->cmnd[9] = (rq_data_dir(rq) == READ) ? READ_32 : WRITE_32; 638 SCpnt->cmnd[9] = (rq_data_dir(rq) == READ) ? READ_32 : WRITE_32;
639 SCpnt->cmnd[10] = protect | (blk_fua_rq(rq) ? 0x8 : 0); 639 SCpnt->cmnd[10] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
640 640
641 /* LBA */ 641 /* LBA */
642 SCpnt->cmnd[12] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0; 642 SCpnt->cmnd[12] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0;
@@ -661,7 +661,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
661 SCpnt->cmnd[31] = (unsigned char) this_count & 0xff; 661 SCpnt->cmnd[31] = (unsigned char) this_count & 0xff;
662 } else if (block > 0xffffffff) { 662 } else if (block > 0xffffffff) {
663 SCpnt->cmnd[0] += READ_16 - READ_6; 663 SCpnt->cmnd[0] += READ_16 - READ_6;
664 SCpnt->cmnd[1] = protect | (blk_fua_rq(rq) ? 0x8 : 0); 664 SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
665 SCpnt->cmnd[2] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0; 665 SCpnt->cmnd[2] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0;
666 SCpnt->cmnd[3] = sizeof(block) > 4 ? (unsigned char) (block >> 48) & 0xff : 0; 666 SCpnt->cmnd[3] = sizeof(block) > 4 ? (unsigned char) (block >> 48) & 0xff : 0;
667 SCpnt->cmnd[4] = sizeof(block) > 4 ? (unsigned char) (block >> 40) & 0xff : 0; 667 SCpnt->cmnd[4] = sizeof(block) > 4 ? (unsigned char) (block >> 40) & 0xff : 0;
@@ -682,7 +682,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
682 this_count = 0xffff; 682 this_count = 0xffff;
683 683
684 SCpnt->cmnd[0] += READ_10 - READ_6; 684 SCpnt->cmnd[0] += READ_10 - READ_6;
685 SCpnt->cmnd[1] = protect | (blk_fua_rq(rq) ? 0x8 : 0); 685 SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
686 SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff; 686 SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff;
687 SCpnt->cmnd[3] = (unsigned char) (block >> 16) & 0xff; 687 SCpnt->cmnd[3] = (unsigned char) (block >> 16) & 0xff;
688 SCpnt->cmnd[4] = (unsigned char) (block >> 8) & 0xff; 688 SCpnt->cmnd[4] = (unsigned char) (block >> 8) & 0xff;
@@ -691,7 +691,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
691 SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff; 691 SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff;
692 SCpnt->cmnd[8] = (unsigned char) this_count & 0xff; 692 SCpnt->cmnd[8] = (unsigned char) this_count & 0xff;
693 } else { 693 } else {
694 if (unlikely(blk_fua_rq(rq))) { 694 if (unlikely(rq->cmd_flags & REQ_FUA)) {
695 /* 695 /*
696 * This happens only if this drive failed 696 * This happens only if this drive failed
697 * 10byte rw command with ILLEGAL_REQUEST 697 * 10byte rw command with ILLEGAL_REQUEST
@@ -1112,7 +1112,7 @@ static unsigned int sd_completed_bytes(struct scsi_cmnd *scmd)
1112 u64 bad_lba; 1112 u64 bad_lba;
1113 int info_valid; 1113 int info_valid;
1114 1114
1115 if (!blk_fs_request(scmd->request)) 1115 if (scmd->request->cmd_type != REQ_TYPE_FS)
1116 return 0; 1116 return 0;
1117 1117
1118 info_valid = scsi_get_sense_info_fld(scmd->sense_buffer, 1118 info_valid = scsi_get_sense_info_fld(scmd->sense_buffer,