aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-05-07 09:24:42 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 03:50:55 -0400
commitb0790410300abaaf4f25f702803beff701baebf1 (patch)
tree63d8fcd38e4cd5927fd83e482e306480bb68a689 /drivers/block
parent2e46e8b27aa57c6bd34b3102b40ee4d0144b4fab (diff)
block: cleanup rq->data_len usages
With recent unification of fields, it's now guaranteed that rq->data_len always equals blk_rq_bytes(). Convert all non-IDE direct users to accessors. IDE will be converted in a separate patch. Boaz: spotted incorrect data_len/resid_len conversion in osd. [ Impact: convert direct rq->data_len usages to blk_rq_bytes() ] Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: Eric Moore <Eric.Moore@lsi.com> Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Cc: Darrick J. Wong <djwong@us.ibm.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Eric Moore <Eric.Moore@lsi.com> Cc: Boaz Harrosh <bharrosh@panasas.com> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block')
-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 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) {