aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pd.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-05-07 09:24:39 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 03:50:54 -0400
commit83096ebf1263b2c1ee5e653ba37d993d02e3eb7b (patch)
tree2226b71a616ec1cb2d37511c6a09ba9507a1cd69 /drivers/block/paride/pd.c
parent5b93629b4509c03ffa87a9316412fedf6f58cb37 (diff)
block: convert to pos and nr_sectors accessors
With recent cleanups, there is no place where low level driver directly manipulates request fields. This means that the 'hard' request fields always equal the !hard fields. Convert all rq->sectors, nr_sectors and current_nr_sectors references to accessors. While at it, drop superflous blk_rq_pos() < 0 test in swim.c. [ Impact: use pos and nr_sectors accessors ] Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Tested-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Acked-by: Mike Miller <mike.miller@hp.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Eric Moore <Eric.Moore@lsi.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Tim Waugh <tim@cyberelk.net> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Dario Ballabio <ballabio_dario@emc.com> Cc: David S. Miller <davem@davemloft.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: unsik Kim <donari75@gmail.com> Cc: Laurent Vivier <Laurent@lvivier.info> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/paride/pd.c')
-rw-r--r--drivers/block/paride/pd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 0732df4e901a..9ec5d4ac0b64 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -444,11 +444,11 @@ static enum action do_pd_io_start(void)
444 444
445 pd_cmd = rq_data_dir(pd_req); 445 pd_cmd = rq_data_dir(pd_req);
446 if (pd_cmd == READ || pd_cmd == WRITE) { 446 if (pd_cmd == READ || pd_cmd == WRITE) {
447 pd_block = pd_req->sector; 447 pd_block = blk_rq_pos(pd_req);
448 pd_count = pd_req->current_nr_sectors; 448 pd_count = blk_rq_cur_sectors(pd_req);
449 if (pd_block + pd_count > get_capacity(pd_req->rq_disk)) 449 if (pd_block + pd_count > get_capacity(pd_req->rq_disk))
450 return Fail; 450 return Fail;
451 pd_run = pd_req->nr_sectors; 451 pd_run = blk_rq_sectors(pd_req);
452 pd_buf = pd_req->buffer; 452 pd_buf = pd_req->buffer;
453 pd_retries = 0; 453 pd_retries = 0;
454 if (pd_cmd == READ) 454 if (pd_cmd == READ)
@@ -479,7 +479,7 @@ static int pd_next_buf(void)
479 return 0; 479 return 0;
480 spin_lock_irqsave(&pd_lock, saved_flags); 480 spin_lock_irqsave(&pd_lock, saved_flags);
481 __blk_end_request_cur(pd_req, 0); 481 __blk_end_request_cur(pd_req, 0);
482 pd_count = pd_req->current_nr_sectors; 482 pd_count = blk_rq_cur_sectors(pd_req);
483 pd_buf = pd_req->buffer; 483 pd_buf = pd_req->buffer;
484 spin_unlock_irqrestore(&pd_lock, saved_flags); 484 spin_unlock_irqrestore(&pd_lock, saved_flags);
485 return 0; 485 return 0;