diff options
author | Tejun Heo <tj@kernel.org> | 2009-05-07 09:24:38 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-11 03:50:53 -0400 |
commit | 5b93629b4509c03ffa87a9316412fedf6f58cb37 (patch) | |
tree | ad5ceda3f718361b8df3057b4f9edcc79aa4cd9d /drivers/block | |
parent | c3a4d78c580de4edc9ef0f7c59812fb02ceb037f (diff) |
block: implement blk_rq_pos/[cur_]sectors() and convert obvious ones
Implement accessors - blk_rq_pos(), blk_rq_sectors() and
blk_rq_cur_sectors() which return rq->hard_sector, rq->hard_nr_sectors
and rq->hard_cur_sectors respectively and convert direct references of
the said fields to the accessors.
This is in preparation of request data length handling cleanup.
Geert : suggested adding const to struct request * parameter to accessors
Sergei : spotted error in patch description
[ Impact: cleanup ]
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Ackec-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ps3disk.c | 2 | ||||
-rw-r--r-- | drivers/block/viodasd.c | 6 | ||||
-rw-r--r-- | drivers/block/xsysace.c | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index f6586e4d351c..c2388673684e 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c | |||
@@ -136,7 +136,7 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev, | |||
136 | dev_dbg(&dev->sbd.core, | 136 | dev_dbg(&dev->sbd.core, |
137 | "%s:%u: %s req has %u bvecs for %lu sectors %lu hard sectors\n", | 137 | "%s:%u: %s req has %u bvecs for %lu sectors %lu hard sectors\n", |
138 | __func__, __LINE__, op, n, req->nr_sectors, | 138 | __func__, __LINE__, op, n, req->nr_sectors, |
139 | req->hard_nr_sectors); | 139 | blk_rq_sectors(req)); |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | start_sector = req->sector * priv->blocking_factor; | 142 | start_sector = req->sector * priv->blocking_factor; |
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index ecccf65dce2f..e821eed7132f 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c | |||
@@ -368,12 +368,12 @@ static void do_viodasd_request(struct request_queue *q) | |||
368 | blkdev_dequeue_request(req); | 368 | blkdev_dequeue_request(req); |
369 | /* check that request contains a valid command */ | 369 | /* check that request contains a valid command */ |
370 | if (!blk_fs_request(req)) { | 370 | if (!blk_fs_request(req)) { |
371 | viodasd_end_request(req, -EIO, req->hard_nr_sectors); | 371 | viodasd_end_request(req, -EIO, blk_rq_sectors(req)); |
372 | continue; | 372 | continue; |
373 | } | 373 | } |
374 | /* Try sending the request */ | 374 | /* Try sending the request */ |
375 | if (send_request(req) != 0) | 375 | if (send_request(req) != 0) |
376 | viodasd_end_request(req, -EIO, req->hard_nr_sectors); | 376 | viodasd_end_request(req, -EIO, blk_rq_sectors(req)); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
@@ -590,7 +590,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent) | |||
590 | err = vio_lookup_rc(viodasd_err_table, bevent->sub_result); | 590 | err = vio_lookup_rc(viodasd_err_table, bevent->sub_result); |
591 | printk(VIOD_KERN_WARNING "read/write error %d:0x%04x (%s)\n", | 591 | printk(VIOD_KERN_WARNING "read/write error %d:0x%04x (%s)\n", |
592 | event->xRc, bevent->sub_result, err->msg); | 592 | event->xRc, bevent->sub_result, err->msg); |
593 | num_sect = req->hard_nr_sectors; | 593 | num_sect = blk_rq_sectors(req); |
594 | } | 594 | } |
595 | qlock = req->q->queue_lock; | 595 | qlock = req->q->queue_lock; |
596 | spin_lock_irqsave(qlock, irq_flags); | 596 | spin_lock_irqsave(qlock, irq_flags); |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index b1e1d7e5ab1e..5722931d14c5 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -645,8 +645,8 @@ static void ace_fsm_dostate(struct ace_device *ace) | |||
645 | 645 | ||
646 | /* Okay, it's a data request, set it up for transfer */ | 646 | /* Okay, it's a data request, set it up for transfer */ |
647 | dev_dbg(ace->dev, | 647 | dev_dbg(ace->dev, |
648 | "request: sec=%llx hcnt=%lx, ccnt=%x, dir=%i\n", | 648 | "request: sec=%llx hcnt=%x, ccnt=%x, dir=%i\n", |
649 | (unsigned long long) req->sector, req->hard_nr_sectors, | 649 | (unsigned long long) req->sector, blk_rq_sectors(req), |
650 | req->current_nr_sectors, rq_data_dir(req)); | 650 | req->current_nr_sectors, rq_data_dir(req)); |
651 | 651 | ||
652 | ace->req = req; | 652 | ace->req = req; |
@@ -654,7 +654,7 @@ static void ace_fsm_dostate(struct ace_device *ace) | |||
654 | ace->data_count = req->current_nr_sectors * ACE_BUF_PER_SECTOR; | 654 | ace->data_count = req->current_nr_sectors * ACE_BUF_PER_SECTOR; |
655 | ace_out32(ace, ACE_MPULBA, req->sector & 0x0FFFFFFF); | 655 | ace_out32(ace, ACE_MPULBA, req->sector & 0x0FFFFFFF); |
656 | 656 | ||
657 | count = req->hard_nr_sectors; | 657 | count = blk_rq_sectors(req); |
658 | if (rq_data_dir(req)) { | 658 | if (rq_data_dir(req)) { |
659 | /* Kick off write request */ | 659 | /* Kick off write request */ |
660 | dev_dbg(ace->dev, "write data\n"); | 660 | dev_dbg(ace->dev, "write data\n"); |
@@ -719,8 +719,8 @@ static void ace_fsm_dostate(struct ace_device *ace) | |||
719 | /* bio finished; is there another one? */ | 719 | /* bio finished; is there another one? */ |
720 | if (__blk_end_request(ace->req, 0, | 720 | if (__blk_end_request(ace->req, 0, |
721 | blk_rq_cur_bytes(ace->req))) { | 721 | blk_rq_cur_bytes(ace->req))) { |
722 | /* dev_dbg(ace->dev, "next block; h=%li c=%i\n", | 722 | /* dev_dbg(ace->dev, "next block; h=%u c=%u\n", |
723 | * ace->req->hard_nr_sectors, | 723 | * blk_rq_sectors(ace->req), |
724 | * ace->req->current_nr_sectors); | 724 | * ace->req->current_nr_sectors); |
725 | */ | 725 | */ |
726 | ace->data_ptr = ace->req->buffer; | 726 | ace->data_ptr = ace->req->buffer; |