aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/ub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r--drivers/block/ub.c8
1 files changed, 4 insertions, 4 deletions
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;