aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cciss.c49
-rw-r--r--drivers/block/hd.c2
-rw-r--r--drivers/block/mg_disk.c4
-rw-r--r--drivers/block/nbd.c2
-rw-r--r--drivers/block/osdblk.c3
-rw-r--r--drivers/block/paride/pd.c2
-rw-r--r--drivers/block/ps3disk.c2
-rw-r--r--drivers/block/ub.c8
-rw-r--r--drivers/block/viodasd.c2
-rw-r--r--drivers/block/virtio_blk.c15
-rw-r--r--drivers/block/xd.c2
-rw-r--r--drivers/block/xen-blkfront.c4
-rw-r--r--drivers/block/xsysace.c2
13 files changed, 56 insertions, 41 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 10a0268a1f92..11b377762b8e 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1783,7 +1783,7 @@ static void cciss_softirq_done(struct request *rq)
1783#endif /* CCISS_DEBUG */ 1783#endif /* CCISS_DEBUG */
1784 1784
1785 /* set the residual count for pc requests */ 1785 /* set the residual count for pc requests */
1786 if (blk_pc_request(rq)) 1786 if (rq->cmd_type == REQ_TYPE_BLOCK_PC)
1787 rq->resid_len = cmd->err_info->ResidualCnt; 1787 rq->resid_len = cmd->err_info->ResidualCnt;
1788 1788
1789 blk_end_request_all(rq, (rq->errors == 0) ? 0 : -EIO); 1789 blk_end_request_all(rq, (rq->errors == 0) ? 0 : -EIO);
@@ -2983,7 +2983,7 @@ static inline int evaluate_target_status(ctlr_info_t *h,
2983 driver_byte = DRIVER_OK; 2983 driver_byte = DRIVER_OK;
2984 msg_byte = cmd->err_info->CommandStatus; /* correct? seems too device specific */ 2984 msg_byte = cmd->err_info->CommandStatus; /* correct? seems too device specific */
2985 2985
2986 if (blk_pc_request(cmd->rq)) 2986 if (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC)
2987 host_byte = DID_PASSTHROUGH; 2987 host_byte = DID_PASSTHROUGH;
2988 else 2988 else
2989 host_byte = DID_OK; 2989 host_byte = DID_OK;
@@ -2992,7 +2992,7 @@ static inline int evaluate_target_status(ctlr_info_t *h,
2992 host_byte, driver_byte); 2992 host_byte, driver_byte);
2993 2993
2994 if (cmd->err_info->ScsiStatus != SAM_STAT_CHECK_CONDITION) { 2994 if (cmd->err_info->ScsiStatus != SAM_STAT_CHECK_CONDITION) {
2995 if (!blk_pc_request(cmd->rq)) 2995 if (cmd->rq->cmd_type != REQ_TYPE_BLOCK_PC)
2996 printk(KERN_WARNING "cciss: cmd %p " 2996 printk(KERN_WARNING "cciss: cmd %p "
2997 "has SCSI Status 0x%x\n", 2997 "has SCSI Status 0x%x\n",
2998 cmd, cmd->err_info->ScsiStatus); 2998 cmd, cmd->err_info->ScsiStatus);
@@ -3002,15 +3002,17 @@ static inline int evaluate_target_status(ctlr_info_t *h,
3002 /* check the sense key */ 3002 /* check the sense key */
3003 sense_key = 0xf & cmd->err_info->SenseInfo[2]; 3003 sense_key = 0xf & cmd->err_info->SenseInfo[2];
3004 /* no status or recovered error */ 3004 /* no status or recovered error */
3005 if (((sense_key == 0x0) || (sense_key == 0x1)) && !blk_pc_request(cmd->rq)) 3005 if (((sense_key == 0x0) || (sense_key == 0x1)) &&
3006 (cmd->rq->cmd_type != REQ_TYPE_BLOCK_PC))
3006 error_value = 0; 3007 error_value = 0;
3007 3008
3008 if (check_for_unit_attention(h, cmd)) { 3009 if (check_for_unit_attention(h, cmd)) {
3009 *retry_cmd = !blk_pc_request(cmd->rq); 3010 *retry_cmd = !(cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC);
3010 return 0; 3011 return 0;
3011 } 3012 }
3012 3013
3013 if (!blk_pc_request(cmd->rq)) { /* Not SG_IO or similar? */ 3014 /* Not SG_IO or similar? */
3015 if (cmd->rq->cmd_type != REQ_TYPE_BLOCK_PC) {
3014 if (error_value != 0) 3016 if (error_value != 0)
3015 printk(KERN_WARNING "cciss: cmd %p has CHECK CONDITION" 3017 printk(KERN_WARNING "cciss: cmd %p has CHECK CONDITION"
3016 " sense key = 0x%x\n", cmd, sense_key); 3018 " sense key = 0x%x\n", cmd, sense_key);
@@ -3052,7 +3054,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3052 rq->errors = evaluate_target_status(h, cmd, &retry_cmd); 3054 rq->errors = evaluate_target_status(h, cmd, &retry_cmd);
3053 break; 3055 break;
3054 case CMD_DATA_UNDERRUN: 3056 case CMD_DATA_UNDERRUN:
3055 if (blk_fs_request(cmd->rq)) { 3057 if (cmd->rq->cmd_type == REQ_TYPE_FS) {
3056 printk(KERN_WARNING "cciss: cmd %p has" 3058 printk(KERN_WARNING "cciss: cmd %p has"
3057 " completed with data underrun " 3059 " completed with data underrun "
3058 "reported\n", cmd); 3060 "reported\n", cmd);
@@ -3060,7 +3062,7 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3060 } 3062 }
3061 break; 3063 break;
3062 case CMD_DATA_OVERRUN: 3064 case CMD_DATA_OVERRUN:
3063 if (blk_fs_request(cmd->rq)) 3065 if (cmd->rq->cmd_type == REQ_TYPE_FS)
3064 printk(KERN_WARNING "cciss: cmd %p has" 3066 printk(KERN_WARNING "cciss: cmd %p has"
3065 " completed with data overrun " 3067 " completed with data overrun "
3066 "reported\n", cmd); 3068 "reported\n", cmd);
@@ -3070,42 +3072,48 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3070 "reported invalid\n", cmd); 3072 "reported invalid\n", cmd);
3071 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3073 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3072 cmd->err_info->CommandStatus, DRIVER_OK, 3074 cmd->err_info->CommandStatus, DRIVER_OK,
3073 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3075 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3076 DID_PASSTHROUGH : DID_ERROR);
3074 break; 3077 break;
3075 case CMD_PROTOCOL_ERR: 3078 case CMD_PROTOCOL_ERR:
3076 printk(KERN_WARNING "cciss: cmd %p has " 3079 printk(KERN_WARNING "cciss: cmd %p has "
3077 "protocol error \n", cmd); 3080 "protocol error \n", cmd);
3078 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3081 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3079 cmd->err_info->CommandStatus, DRIVER_OK, 3082 cmd->err_info->CommandStatus, DRIVER_OK,
3080 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3083 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3084 DID_PASSTHROUGH : DID_ERROR);
3081 break; 3085 break;
3082 case CMD_HARDWARE_ERR: 3086 case CMD_HARDWARE_ERR:
3083 printk(KERN_WARNING "cciss: cmd %p had " 3087 printk(KERN_WARNING "cciss: cmd %p had "
3084 " hardware error\n", cmd); 3088 " hardware error\n", cmd);
3085 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3089 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3086 cmd->err_info->CommandStatus, DRIVER_OK, 3090 cmd->err_info->CommandStatus, DRIVER_OK,
3087 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3091 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3092 DID_PASSTHROUGH : DID_ERROR);
3088 break; 3093 break;
3089 case CMD_CONNECTION_LOST: 3094 case CMD_CONNECTION_LOST:
3090 printk(KERN_WARNING "cciss: cmd %p had " 3095 printk(KERN_WARNING "cciss: cmd %p had "
3091 "connection lost\n", cmd); 3096 "connection lost\n", cmd);
3092 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3097 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3093 cmd->err_info->CommandStatus, DRIVER_OK, 3098 cmd->err_info->CommandStatus, DRIVER_OK,
3094 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3099 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3100 DID_PASSTHROUGH : DID_ERROR);
3095 break; 3101 break;
3096 case CMD_ABORTED: 3102 case CMD_ABORTED:
3097 printk(KERN_WARNING "cciss: cmd %p was " 3103 printk(KERN_WARNING "cciss: cmd %p was "
3098 "aborted\n", cmd); 3104 "aborted\n", cmd);
3099 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3105 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3100 cmd->err_info->CommandStatus, DRIVER_OK, 3106 cmd->err_info->CommandStatus, DRIVER_OK,
3101 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ABORT); 3107 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3108 DID_PASSTHROUGH : DID_ABORT);
3102 break; 3109 break;
3103 case CMD_ABORT_FAILED: 3110 case CMD_ABORT_FAILED:
3104 printk(KERN_WARNING "cciss: cmd %p reports " 3111 printk(KERN_WARNING "cciss: cmd %p reports "
3105 "abort failed\n", cmd); 3112 "abort failed\n", cmd);
3106 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3113 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3107 cmd->err_info->CommandStatus, DRIVER_OK, 3114 cmd->err_info->CommandStatus, DRIVER_OK,
3108 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3115 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3116 DID_PASSTHROUGH : DID_ERROR);
3109 break; 3117 break;
3110 case CMD_UNSOLICITED_ABORT: 3118 case CMD_UNSOLICITED_ABORT:
3111 printk(KERN_WARNING "cciss%d: unsolicited " 3119 printk(KERN_WARNING "cciss%d: unsolicited "
@@ -3121,13 +3129,15 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3121 "many times\n", h->ctlr, cmd); 3129 "many times\n", h->ctlr, cmd);
3122 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3130 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3123 cmd->err_info->CommandStatus, DRIVER_OK, 3131 cmd->err_info->CommandStatus, DRIVER_OK,
3124 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ABORT); 3132 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3133 DID_PASSTHROUGH : DID_ABORT);
3125 break; 3134 break;
3126 case CMD_TIMEOUT: 3135 case CMD_TIMEOUT:
3127 printk(KERN_WARNING "cciss: cmd %p timedout\n", cmd); 3136 printk(KERN_WARNING "cciss: cmd %p timedout\n", cmd);
3128 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3137 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3129 cmd->err_info->CommandStatus, DRIVER_OK, 3138 cmd->err_info->CommandStatus, DRIVER_OK,
3130 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3139 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3140 DID_PASSTHROUGH : DID_ERROR);
3131 break; 3141 break;
3132 default: 3142 default:
3133 printk(KERN_WARNING "cciss: cmd %p returned " 3143 printk(KERN_WARNING "cciss: cmd %p returned "
@@ -3135,7 +3145,8 @@ static inline void complete_command(ctlr_info_t *h, CommandList_struct *cmd,
3135 cmd->err_info->CommandStatus); 3145 cmd->err_info->CommandStatus);
3136 rq->errors = make_status_bytes(SAM_STAT_GOOD, 3146 rq->errors = make_status_bytes(SAM_STAT_GOOD,
3137 cmd->err_info->CommandStatus, DRIVER_OK, 3147 cmd->err_info->CommandStatus, DRIVER_OK,
3138 blk_pc_request(cmd->rq) ? DID_PASSTHROUGH : DID_ERROR); 3148 (cmd->rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
3149 DID_PASSTHROUGH : DID_ERROR);
3139 } 3150 }
3140 3151
3141after_error_processing: 3152after_error_processing:
@@ -3294,7 +3305,7 @@ static void do_cciss_request(struct request_queue *q)
3294 c->Header.SGList = h->max_cmd_sgentries; 3305 c->Header.SGList = h->max_cmd_sgentries;
3295 set_performant_mode(h, c); 3306 set_performant_mode(h, c);
3296 3307
3297 if (likely(blk_fs_request(creq))) { 3308 if (likely(creq->cmd_type == REQ_TYPE_FS)) {
3298 if(h->cciss_read == CCISS_READ_10) { 3309 if(h->cciss_read == CCISS_READ_10) {
3299 c->Request.CDB[1] = 0; 3310 c->Request.CDB[1] = 0;
3300 c->Request.CDB[2] = (start_blk >> 24) & 0xff; /* MSB */ 3311 c->Request.CDB[2] = (start_blk >> 24) & 0xff; /* MSB */
@@ -3324,7 +3335,7 @@ static void do_cciss_request(struct request_queue *q)
3324 c->Request.CDB[13]= blk_rq_sectors(creq) & 0xff; 3335 c->Request.CDB[13]= blk_rq_sectors(creq) & 0xff;
3325 c->Request.CDB[14] = c->Request.CDB[15] = 0; 3336 c->Request.CDB[14] = c->Request.CDB[15] = 0;
3326 } 3337 }
3327 } else if (blk_pc_request(creq)) { 3338 } else if (creq->cmd_type == REQ_TYPE_BLOCK_PC) {
3328 c->Request.CDBLen = creq->cmd_len; 3339 c->Request.CDBLen = creq->cmd_len;
3329 memcpy(c->Request.CDB, creq->cmd, BLK_MAX_CDB); 3340 memcpy(c->Request.CDB, creq->cmd, BLK_MAX_CDB);
3330 } else { 3341 } else {
diff --git a/drivers/block/hd.c b/drivers/block/hd.c
index 81c78b3ce2df..30ec6b37424e 100644
--- a/drivers/block/hd.c
+++ b/drivers/block/hd.c
@@ -627,7 +627,7 @@ repeat:
627 req_data_dir(req) == READ ? "read" : "writ", 627 req_data_dir(req) == READ ? "read" : "writ",
628 cyl, head, sec, nsect, req->buffer); 628 cyl, head, sec, nsect, req->buffer);
629#endif 629#endif
630 if (blk_fs_request(req)) { 630 if (req->cmd_type == REQ_TYPE_FS) {
631 switch (rq_data_dir(req)) { 631 switch (rq_data_dir(req)) {
632 case READ: 632 case READ:
633 hd_out(disk, nsect, sec, head, cyl, ATA_CMD_PIO_READ, 633 hd_out(disk, nsect, sec, head, cyl, ATA_CMD_PIO_READ,
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 28db925dbdad..b82c5ce5e9df 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -670,7 +670,7 @@ static void mg_request_poll(struct request_queue *q)
670 break; 670 break;
671 } 671 }
672 672
673 if (unlikely(!blk_fs_request(host->req))) { 673 if (unlikely(host->req->cmd_type != REQ_TYPE_FS)) {
674 mg_end_request_cur(host, -EIO); 674 mg_end_request_cur(host, -EIO);
675 continue; 675 continue;
676 } 676 }
@@ -756,7 +756,7 @@ static void mg_request(struct request_queue *q)
756 continue; 756 continue;
757 } 757 }
758 758
759 if (unlikely(!blk_fs_request(req))) { 759 if (unlikely(req->cmd_type != REQ_TYPE_FS)) {
760 mg_end_request_cur(host, -EIO); 760 mg_end_request_cur(host, -EIO);
761 continue; 761 continue;
762 } 762 }
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 218d091f3c52..2e74e7d475ca 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -448,7 +448,7 @@ static void nbd_clear_que(struct nbd_device *lo)
448 448
449static void nbd_handle_req(struct nbd_device *lo, struct request *req) 449static void nbd_handle_req(struct nbd_device *lo, struct request *req)
450{ 450{
451 if (!blk_fs_request(req)) 451 if (req->cmd_type != REQ_TYPE_FS)
452 goto error_out; 452 goto error_out;
453 453
454 nbd_cmd(req) = NBD_CMD_READ; 454 nbd_cmd(req) = NBD_CMD_READ;
diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c
index 6cd8b705b11b..819002ba3433 100644
--- a/drivers/block/osdblk.c
+++ b/drivers/block/osdblk.c
@@ -310,7 +310,8 @@ static void osdblk_rq_fn(struct request_queue *q)
310 break; 310 break;
311 311
312 /* filter out block requests we don't understand */ 312 /* filter out block requests we don't understand */
313 if (!blk_fs_request(rq) && !blk_barrier_rq(rq)) { 313 if (rq->cmd_type != REQ_TYPE_FS &&
314 !(rq->cmd_flags & REQ_HARDBARRIER)) {
314 blk_end_request_all(rq, 0); 315 blk_end_request_all(rq, 0);
315 continue; 316 continue;
316 } 317 }
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index c1e5cd029b23..4e8b9bff3abe 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -439,7 +439,7 @@ static char *pd_buf; /* buffer for request in progress */
439 439
440static enum action do_pd_io_start(void) 440static enum action do_pd_io_start(void)
441{ 441{
442 if (blk_special_request(pd_req)) { 442 if (pd_req->cmd_type == REQ_TYPE_SPECIAL) {
443 phase = pd_special; 443 phase = pd_special;
444 return pd_special(); 444 return pd_special();
445 } 445 }
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index 3b419e3fffa1..5f208c0bf156 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -196,7 +196,7 @@ static void ps3disk_do_request(struct ps3_storage_device *dev,
196 dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); 196 dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__);
197 197
198 while ((req = blk_fetch_request(q))) { 198 while ((req = blk_fetch_request(q))) {
199 if (blk_fs_request(req)) { 199 if (req->cmd_type == REQ_TYPE_FS) {
200 if (ps3disk_submit_request_sg(dev, req)) 200 if (ps3disk_submit_request_sg(dev, req))
201 break; 201 break;
202 } else if (req->cmd_type == REQ_TYPE_LINUX_BLOCK && 202 } else if (req->cmd_type == REQ_TYPE_LINUX_BLOCK &&
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 0536b5b29adc..034b34440ffa 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -648,7 +648,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
648 return 0; 648 return 0;
649 } 649 }
650 650
651 if (lun->changed && !blk_pc_request(rq)) { 651 if (lun->changed && rq->cmd_type != REQ_TYPE_BLOCK_PC)
652 blk_start_request(rq); 652 blk_start_request(rq);
653 ub_end_rq(rq, SAM_STAT_CHECK_CONDITION); 653 ub_end_rq(rq, SAM_STAT_CHECK_CONDITION);
654 return 0; 654 return 0;
@@ -684,7 +684,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
684 } 684 }
685 urq->nsg = n_elem; 685 urq->nsg = n_elem;
686 686
687 if (blk_pc_request(rq)) { 687 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
688 ub_cmd_build_packet(sc, lun, cmd, urq); 688 ub_cmd_build_packet(sc, lun, cmd, urq);
689 } else { 689 } else {
690 ub_cmd_build_block(sc, lun, cmd, urq); 690 ub_cmd_build_block(sc, lun, cmd, urq);
@@ -781,7 +781,7 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
781 rq = urq->rq; 781 rq = urq->rq;
782 782
783 if (cmd->error == 0) { 783 if (cmd->error == 0) {
784 if (blk_pc_request(rq)) { 784 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
785 if (cmd->act_len >= rq->resid_len) 785 if (cmd->act_len >= rq->resid_len)
786 rq->resid_len = 0; 786 rq->resid_len = 0;
787 else 787 else
@@ -795,7 +795,7 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
795 } 795 }
796 } 796 }
797 } else { 797 } else {
798 if (blk_pc_request(rq)) { 798 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
799 /* UB_SENSE_SIZE is smaller than SCSI_SENSE_BUFFERSIZE */ 799 /* UB_SENSE_SIZE is smaller than SCSI_SENSE_BUFFERSIZE */
800 memcpy(rq->sense, sc->top_sense, UB_SENSE_SIZE); 800 memcpy(rq->sense, sc->top_sense, UB_SENSE_SIZE);
801 rq->sense_len = UB_SENSE_SIZE; 801 rq->sense_len = UB_SENSE_SIZE;
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index 788d93882ab9..5663d3c284c8 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -361,7 +361,7 @@ static void do_viodasd_request(struct request_queue *q)
361 if (req == NULL) 361 if (req == NULL)
362 return; 362 return;
363 /* check that request contains a valid command */ 363 /* check that request contains a valid command */
364 if (!blk_fs_request(req)) { 364 if (req->cmd_type != REQ_TYPE_FS) {
365 viodasd_end_request(req, -EIO, blk_rq_sectors(req)); 365 viodasd_end_request(req, -EIO, blk_rq_sectors(req));
366 continue; 366 continue;
367 } 367 }
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 258bc2ae2885..774144334ece 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -65,13 +65,16 @@ static void blk_done(struct virtqueue *vq)
65 break; 65 break;
66 } 66 }
67 67
68 if (blk_pc_request(vbr->req)) { 68 switch (vbr->req->cmd_type) {
69 case REQ_TYPE_BLOCK_PC:
69 vbr->req->resid_len = vbr->in_hdr.residual; 70 vbr->req->resid_len = vbr->in_hdr.residual;
70 vbr->req->sense_len = vbr->in_hdr.sense_len; 71 vbr->req->sense_len = vbr->in_hdr.sense_len;
71 vbr->req->errors = vbr->in_hdr.errors; 72 vbr->req->errors = vbr->in_hdr.errors;
72 } 73 break;
73 if (blk_special_request(vbr->req)) 74 case REQ_TYPE_SPECIAL:
74 vbr->req->errors = (error != 0); 75 vbr->req->errors = (error != 0);
76 break;
77 }
75 78
76 __blk_end_request_all(vbr->req, error); 79 __blk_end_request_all(vbr->req, error);
77 list_del(&vbr->list); 80 list_del(&vbr->list);
@@ -123,7 +126,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
123 BUG(); 126 BUG();
124 } 127 }
125 128
126 if (blk_barrier_rq(vbr->req)) 129 if (vbr->req->cmd_flags & REQ_HARDBARRIER)
127 vbr->out_hdr.type |= VIRTIO_BLK_T_BARRIER; 130 vbr->out_hdr.type |= VIRTIO_BLK_T_BARRIER;
128 131
129 sg_set_buf(&vblk->sg[out++], &vbr->out_hdr, sizeof(vbr->out_hdr)); 132 sg_set_buf(&vblk->sg[out++], &vbr->out_hdr, sizeof(vbr->out_hdr));
@@ -134,12 +137,12 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
134 * block, and before the normal inhdr we put the sense data and the 137 * block, and before the normal inhdr we put the sense data and the
135 * inhdr with additional status information before the normal inhdr. 138 * inhdr with additional status information before the normal inhdr.
136 */ 139 */
137 if (blk_pc_request(vbr->req)) 140 if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC)
138 sg_set_buf(&vblk->sg[out++], vbr->req->cmd, vbr->req->cmd_len); 141 sg_set_buf(&vblk->sg[out++], vbr->req->cmd, vbr->req->cmd_len);
139 142
140 num = blk_rq_map_sg(q, vbr->req, vblk->sg + out); 143 num = blk_rq_map_sg(q, vbr->req, vblk->sg + out);
141 144
142 if (blk_pc_request(vbr->req)) { 145 if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC) {
143 sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, 96); 146 sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, 96);
144 sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr, 147 sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr,
145 sizeof(vbr->in_hdr)); 148 sizeof(vbr->in_hdr));
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 18a80ff57ce8..4dc298376098 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -322,7 +322,7 @@ static void do_xd_request (struct request_queue * q)
322 int res = -EIO; 322 int res = -EIO;
323 int retry; 323 int retry;
324 324
325 if (!blk_fs_request(req)) 325 if (req->cmd_type != REQ_TYPE_FS) {
326 goto done; 326 goto done;
327 if (block + count > get_capacity(req->rq_disk)) 327 if (block + count > get_capacity(req->rq_disk))
328 goto done; 328 goto done;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 82ed403147c0..495533e66542 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -238,7 +238,7 @@ static int blkif_queue_request(struct request *req)
238 238
239 ring_req->operation = rq_data_dir(req) ? 239 ring_req->operation = rq_data_dir(req) ?
240 BLKIF_OP_WRITE : BLKIF_OP_READ; 240 BLKIF_OP_WRITE : BLKIF_OP_READ;
241 if (blk_barrier_rq(req)) 241 if (req->cmd_flags & REQ_HARDBARRIER)
242 ring_req->operation = BLKIF_OP_WRITE_BARRIER; 242 ring_req->operation = BLKIF_OP_WRITE_BARRIER;
243 243
244 ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg); 244 ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg);
@@ -309,7 +309,7 @@ static void do_blkif_request(struct request_queue *rq)
309 309
310 blk_start_request(req); 310 blk_start_request(req);
311 311
312 if (!blk_fs_request(req)) { 312 if (req->cmd_type != REQ_TYPE_FS) {
313 __blk_end_request_all(req, -EIO); 313 __blk_end_request_all(req, -EIO);
314 continue; 314 continue;
315 } 315 }
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index a7b83c0a7eb5..ac278ac908d5 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -465,7 +465,7 @@ struct request *ace_get_next_request(struct request_queue * q)
465 struct request *req; 465 struct request *req;
466 466
467 while ((req = blk_peek_request(q)) != NULL) { 467 while ((req = blk_peek_request(q)) != NULL) {
468 if (blk_fs_request(req)) 468 if (req->cmd_type == REQ_TYPE_FS)
469 break; 469 break;
470 blk_start_request(req); 470 blk_start_request(req);
471 __blk_end_request_all(req, -EIO); 471 __blk_end_request_all(req, -EIO);