summaryrefslogtreecommitdiff
path: root/drivers/block/ub.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-05-07 17:24:42 +0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 11:50:55 +0400
commitb0790410300abaaf4f25f702803beff701baebf1 (patch)
tree63d8fcd38e4cd5927fd83e482e306480bb68a689 /drivers/block/ub.c
parent2e46e8b27aa57c6bd34b3102b40ee4d0144b4fab (diff)
downloadlinux-b0790410300abaaf4f25f702803beff701baebf1.tar.xz
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/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 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,
{
struct request *rq = urq->rq;
- if (rq->data_len == 0) {
+ if (blk_rq_bytes(rq) == 0) {
cmd->dir = UB_DIR_NONE;
} else {
if (rq_data_dir(rq) == WRITE)
@@ -762,7 +762,7 @@ static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,
memcpy(&cmd->cdb, rq->cmd, rq->cmd_len);
cmd->cdb_len = rq->cmd_len;
- cmd->len = rq->data_len;
+ cmd->len = blk_rq_bytes(rq);
/*
* 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)
if (cmd->error == 0) {
if (blk_pc_request(rq)) {
- if (cmd->act_len < rq->data_len)
- rq->resid_len = rq->data_len - cmd->act_len;
+ if (cmd->act_len < blk_rq_bytes(rq))
+ rq->resid_len = blk_rq_bytes(rq) - cmd->act_len;
scsi_status = 0;
} else {
if (cmd->act_len != cmd->len) {