diff options
author | Christoph Hellwig <hch@lst.de> | 2010-08-07 12:17:56 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:17:56 -0400 |
commit | 33659ebbae262228eef4e0fe990f393d1f0ed941 (patch) | |
tree | fcb537f09359c8dad3a6f6e16dc4319562dc42cc /drivers/scsi | |
parent | 7e005f79791dcd58436c88ded4a7f5aed1b82147 (diff) |
block: remove wrappers for request type/flags
Remove all the trivial wrappers for the cmd_type and cmd_flags fields in
struct requests. This allows much easier grepping for different request
types instead of unwinding through macros.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_error.c | 10 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 5 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 12 | ||||
-rw-r--r-- | drivers/scsi/sun3_NCR5380.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sun3_scsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/sun3_scsi_vme.c | 2 |
6 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a5d630f5f519..1b88af89d0c7 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -307,7 +307,7 @@ static int scsi_check_sense(struct scsi_cmnd *scmd) | |||
307 | (sshdr.asc == 0x04) && (sshdr.ascq == 0x02)) | 307 | (sshdr.asc == 0x04) && (sshdr.ascq == 0x02)) |
308 | return FAILED; | 308 | return FAILED; |
309 | 309 | ||
310 | if (blk_barrier_rq(scmd->request)) | 310 | if (scmd->request->cmd_flags & REQ_HARDBARRIER) |
311 | /* | 311 | /* |
312 | * barrier requests should always retry on UA | 312 | * barrier requests should always retry on UA |
313 | * otherwise block will get a spurious error | 313 | * otherwise block will get a spurious error |
@@ -1318,16 +1318,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) | |||
1318 | case DID_OK: | 1318 | case DID_OK: |
1319 | break; | 1319 | break; |
1320 | case DID_BUS_BUSY: | 1320 | case DID_BUS_BUSY: |
1321 | return blk_failfast_transport(scmd->request); | 1321 | return (scmd->request->cmd_flags & REQ_FAILFAST_TRANSPORT); |
1322 | case DID_PARITY: | 1322 | case DID_PARITY: |
1323 | return blk_failfast_dev(scmd->request); | 1323 | return (scmd->request->cmd_flags & REQ_FAILFAST_DEV); |
1324 | case DID_ERROR: | 1324 | case DID_ERROR: |
1325 | if (msg_byte(scmd->result) == COMMAND_COMPLETE && | 1325 | if (msg_byte(scmd->result) == COMMAND_COMPLETE && |
1326 | status_byte(scmd->result) == RESERVATION_CONFLICT) | 1326 | status_byte(scmd->result) == RESERVATION_CONFLICT) |
1327 | return 0; | 1327 | return 0; |
1328 | /* fall through */ | 1328 | /* fall through */ |
1329 | case DID_SOFT_ERROR: | 1329 | case DID_SOFT_ERROR: |
1330 | return blk_failfast_driver(scmd->request); | 1330 | return (scmd->request->cmd_flags & REQ_FAILFAST_DRIVER); |
1331 | } | 1331 | } |
1332 | 1332 | ||
1333 | switch (status_byte(scmd->result)) { | 1333 | switch (status_byte(scmd->result)) { |
@@ -1336,7 +1336,7 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd) | |||
1336 | * assume caller has checked sense and determinted | 1336 | * assume caller has checked sense and determinted |
1337 | * the check condition was retryable. | 1337 | * the check condition was retryable. |
1338 | */ | 1338 | */ |
1339 | return blk_failfast_dev(scmd->request); | 1339 | return (scmd->request->cmd_flags & REQ_FAILFAST_DEV); |
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | return 0; | 1342 | return 0; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1646fe7cbd4b..5f1160841b0e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -722,7 +722,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
722 | sense_deferred = scsi_sense_is_deferred(&sshdr); | 722 | sense_deferred = scsi_sense_is_deferred(&sshdr); |
723 | } | 723 | } |
724 | 724 | ||
725 | if (blk_pc_request(req)) { /* SG_IO ioctl from block level */ | 725 | if (req->cmd_type == REQ_TYPE_BLOCK_PC) { /* SG_IO ioctl from block level */ |
726 | req->errors = result; | 726 | req->errors = result; |
727 | if (result) { | 727 | if (result) { |
728 | if (sense_valid && req->sense) { | 728 | if (sense_valid && req->sense) { |
@@ -757,7 +757,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
757 | } | 757 | } |
758 | } | 758 | } |
759 | 759 | ||
760 | BUG_ON(blk_bidi_rq(req)); /* bidi not support for !blk_pc_request yet */ | 760 | /* no bidi support for !REQ_TYPE_BLOCK_PC yet */ |
761 | BUG_ON(blk_bidi_rq(req)); | ||
761 | 762 | ||
762 | /* | 763 | /* |
763 | * Next deal with any sectors which we were able to correctly | 764 | * Next deal with any sectors which we were able to correctly |
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, |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index b5838d547c68..713620ed70d9 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
@@ -2022,7 +2022,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) | |||
2022 | if((count > SUN3_DMA_MINSIZE) && (sun3_dma_setup_done | 2022 | if((count > SUN3_DMA_MINSIZE) && (sun3_dma_setup_done |
2023 | != cmd)) | 2023 | != cmd)) |
2024 | { | 2024 | { |
2025 | if(blk_fs_request(cmd->request)) { | 2025 | if (cmd->request->cmd_type == REQ_TYPE_FS) { |
2026 | sun3scsi_dma_setup(d, count, | 2026 | sun3scsi_dma_setup(d, count, |
2027 | rq_data_dir(cmd->request)); | 2027 | rq_data_dir(cmd->request)); |
2028 | sun3_dma_setup_done = cmd; | 2028 | sun3_dma_setup_done = cmd; |
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index e606cf0a2eb7..613f5880d135 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c | |||
@@ -524,7 +524,7 @@ static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, | |||
524 | struct scsi_cmnd *cmd, | 524 | struct scsi_cmnd *cmd, |
525 | int write_flag) | 525 | int write_flag) |
526 | { | 526 | { |
527 | if(blk_fs_request(cmd->request)) | 527 | if (cmd->request->cmd_type == REQ_TYPE_FS) |
528 | return wanted; | 528 | return wanted; |
529 | else | 529 | else |
530 | return 0; | 530 | return 0; |
diff --git a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c index aaa4fd0dd1b9..7c526b8e30ac 100644 --- a/drivers/scsi/sun3_scsi_vme.c +++ b/drivers/scsi/sun3_scsi_vme.c | |||
@@ -458,7 +458,7 @@ static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, | |||
458 | struct scsi_cmnd *cmd, | 458 | struct scsi_cmnd *cmd, |
459 | int write_flag) | 459 | int write_flag) |
460 | { | 460 | { |
461 | if(blk_fs_request(cmd->request)) | 461 | if (cmd->request->cmd_type == REQ_TYPE_FS) |
462 | return wanted; | 462 | return wanted; |
463 | else | 463 | else |
464 | return 0; | 464 | return 0; |