diff options
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r-- | drivers/block/ub.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index dc3b899ad2b3..1591f61b6c60 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -747,7 +747,7 @@ static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, | |||
747 | { | 747 | { |
748 | struct request *rq = urq->rq; | 748 | struct request *rq = urq->rq; |
749 | 749 | ||
750 | if (rq->data_len == 0) { | 750 | if (blk_rq_bytes(rq) == 0) { |
751 | cmd->dir = UB_DIR_NONE; | 751 | cmd->dir = UB_DIR_NONE; |
752 | } else { | 752 | } else { |
753 | if (rq_data_dir(rq) == WRITE) | 753 | if (rq_data_dir(rq) == WRITE) |
@@ -762,7 +762,7 @@ static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, | |||
762 | memcpy(&cmd->cdb, rq->cmd, rq->cmd_len); | 762 | memcpy(&cmd->cdb, rq->cmd, rq->cmd_len); |
763 | cmd->cdb_len = rq->cmd_len; | 763 | cmd->cdb_len = rq->cmd_len; |
764 | 764 | ||
765 | cmd->len = rq->data_len; | 765 | cmd->len = blk_rq_bytes(rq); |
766 | 766 | ||
767 | /* | 767 | /* |
768 | * To reapply this to every URB is not as incorrect as it looks. | 768 | * To reapply this to every URB is not as incorrect as it looks. |
@@ -783,8 +783,8 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd) | |||
783 | 783 | ||
784 | if (cmd->error == 0) { | 784 | if (cmd->error == 0) { |
785 | if (blk_pc_request(rq)) { | 785 | if (blk_pc_request(rq)) { |
786 | if (cmd->act_len < rq->data_len) | 786 | if (cmd->act_len < blk_rq_bytes(rq)) |
787 | rq->resid_len = rq->data_len - cmd->act_len; | 787 | rq->resid_len = blk_rq_bytes(rq) - cmd->act_len; |
788 | scsi_status = 0; | 788 | scsi_status = 0; |
789 | } else { | 789 | } else { |
790 | if (cmd->act_len != cmd->len) { | 790 | if (cmd->act_len != cmd->len) { |