diff options
author | Tejun Heo <tj@kernel.org> | 2009-05-07 09:24:39 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-11 03:50:54 -0400 |
commit | 83096ebf1263b2c1ee5e653ba37d993d02e3eb7b (patch) | |
tree | 2226b71a616ec1cb2d37511c6a09ba9507a1cd69 /drivers/block/cciss.c | |
parent | 5b93629b4509c03ffa87a9316412fedf6f58cb37 (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/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index f22d4932433f..ab7b04c0db70 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -2835,10 +2835,10 @@ static void do_cciss_request(struct request_queue *q) | |||
2835 | c->Request.Timeout = 0; // Don't time out | 2835 | c->Request.Timeout = 0; // Don't time out |
2836 | c->Request.CDB[0] = | 2836 | c->Request.CDB[0] = |
2837 | (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write; | 2837 | (rq_data_dir(creq) == READ) ? h->cciss_read : h->cciss_write; |
2838 | start_blk = creq->sector; | 2838 | start_blk = blk_rq_pos(creq); |
2839 | #ifdef CCISS_DEBUG | 2839 | #ifdef CCISS_DEBUG |
2840 | printk(KERN_DEBUG "ciss: sector =%d nr_sectors=%d\n", (int)creq->sector, | 2840 | printk(KERN_DEBUG "ciss: sector =%d nr_sectors=%d\n", |
2841 | (int)creq->nr_sectors); | 2841 | (int)blk_rq_pos(creq), (int)blk_rq_sectors(creq)); |
2842 | #endif /* CCISS_DEBUG */ | 2842 | #endif /* CCISS_DEBUG */ |
2843 | 2843 | ||
2844 | sg_init_table(tmp_sg, MAXSGENTRIES); | 2844 | sg_init_table(tmp_sg, MAXSGENTRIES); |
@@ -2864,8 +2864,8 @@ static void do_cciss_request(struct request_queue *q) | |||
2864 | h->maxSG = seg; | 2864 | h->maxSG = seg; |
2865 | 2865 | ||
2866 | #ifdef CCISS_DEBUG | 2866 | #ifdef CCISS_DEBUG |
2867 | printk(KERN_DEBUG "cciss: Submitting %lu sectors in %d segments\n", | 2867 | printk(KERN_DEBUG "cciss: Submitting %u sectors in %d segments\n", |
2868 | creq->nr_sectors, seg); | 2868 | blk_rq_sectors(creq), seg); |
2869 | #endif /* CCISS_DEBUG */ | 2869 | #endif /* CCISS_DEBUG */ |
2870 | 2870 | ||
2871 | c->Header.SGList = c->Header.SGTotal = seg; | 2871 | c->Header.SGList = c->Header.SGTotal = seg; |
@@ -2877,8 +2877,8 @@ static void do_cciss_request(struct request_queue *q) | |||
2877 | c->Request.CDB[4] = (start_blk >> 8) & 0xff; | 2877 | c->Request.CDB[4] = (start_blk >> 8) & 0xff; |
2878 | c->Request.CDB[5] = start_blk & 0xff; | 2878 | c->Request.CDB[5] = start_blk & 0xff; |
2879 | c->Request.CDB[6] = 0; // (sect >> 24) & 0xff; MSB | 2879 | c->Request.CDB[6] = 0; // (sect >> 24) & 0xff; MSB |
2880 | c->Request.CDB[7] = (creq->nr_sectors >> 8) & 0xff; | 2880 | c->Request.CDB[7] = (blk_rq_sectors(creq) >> 8) & 0xff; |
2881 | c->Request.CDB[8] = creq->nr_sectors & 0xff; | 2881 | c->Request.CDB[8] = blk_rq_sectors(creq) & 0xff; |
2882 | c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0; | 2882 | c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0; |
2883 | } else { | 2883 | } else { |
2884 | u32 upper32 = upper_32_bits(start_blk); | 2884 | u32 upper32 = upper_32_bits(start_blk); |
@@ -2893,10 +2893,10 @@ static void do_cciss_request(struct request_queue *q) | |||
2893 | c->Request.CDB[7]= (start_blk >> 16) & 0xff; | 2893 | c->Request.CDB[7]= (start_blk >> 16) & 0xff; |
2894 | c->Request.CDB[8]= (start_blk >> 8) & 0xff; | 2894 | c->Request.CDB[8]= (start_blk >> 8) & 0xff; |
2895 | c->Request.CDB[9]= start_blk & 0xff; | 2895 | c->Request.CDB[9]= start_blk & 0xff; |
2896 | c->Request.CDB[10]= (creq->nr_sectors >> 24) & 0xff; | 2896 | c->Request.CDB[10]= (blk_rq_sectors(creq) >> 24) & 0xff; |
2897 | c->Request.CDB[11]= (creq->nr_sectors >> 16) & 0xff; | 2897 | c->Request.CDB[11]= (blk_rq_sectors(creq) >> 16) & 0xff; |
2898 | c->Request.CDB[12]= (creq->nr_sectors >> 8) & 0xff; | 2898 | c->Request.CDB[12]= (blk_rq_sectors(creq) >> 8) & 0xff; |
2899 | c->Request.CDB[13]= creq->nr_sectors & 0xff; | 2899 | c->Request.CDB[13]= blk_rq_sectors(creq) & 0xff; |
2900 | c->Request.CDB[14] = c->Request.CDB[15] = 0; | 2900 | c->Request.CDB[14] = c->Request.CDB[15] = 0; |
2901 | } | 2901 | } |
2902 | } else if (blk_pc_request(creq)) { | 2902 | } else if (blk_pc_request(creq)) { |