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 /block/cfq-iosched.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 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 575083a9ffe4..db4d990a66bf 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -349,8 +349,8 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2) | |||
349 | else if (rq_is_meta(rq2) && !rq_is_meta(rq1)) | 349 | else if (rq_is_meta(rq2) && !rq_is_meta(rq1)) |
350 | return rq2; | 350 | return rq2; |
351 | 351 | ||
352 | s1 = rq1->sector; | 352 | s1 = blk_rq_pos(rq1); |
353 | s2 = rq2->sector; | 353 | s2 = blk_rq_pos(rq2); |
354 | 354 | ||
355 | last = cfqd->last_position; | 355 | last = cfqd->last_position; |
356 | 356 | ||
@@ -949,10 +949,10 @@ static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd, | |||
949 | static inline sector_t cfq_dist_from_last(struct cfq_data *cfqd, | 949 | static inline sector_t cfq_dist_from_last(struct cfq_data *cfqd, |
950 | struct request *rq) | 950 | struct request *rq) |
951 | { | 951 | { |
952 | if (rq->sector >= cfqd->last_position) | 952 | if (blk_rq_pos(rq) >= cfqd->last_position) |
953 | return rq->sector - cfqd->last_position; | 953 | return blk_rq_pos(rq) - cfqd->last_position; |
954 | else | 954 | else |
955 | return cfqd->last_position - rq->sector; | 955 | return cfqd->last_position - blk_rq_pos(rq); |
956 | } | 956 | } |
957 | 957 | ||
958 | #define CIC_SEEK_THR 8 * 1024 | 958 | #define CIC_SEEK_THR 8 * 1024 |
@@ -1918,10 +1918,10 @@ cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_io_context *cic, | |||
1918 | 1918 | ||
1919 | if (!cic->last_request_pos) | 1919 | if (!cic->last_request_pos) |
1920 | sdist = 0; | 1920 | sdist = 0; |
1921 | else if (cic->last_request_pos < rq->sector) | 1921 | else if (cic->last_request_pos < blk_rq_pos(rq)) |
1922 | sdist = rq->sector - cic->last_request_pos; | 1922 | sdist = blk_rq_pos(rq) - cic->last_request_pos; |
1923 | else | 1923 | else |
1924 | sdist = cic->last_request_pos - rq->sector; | 1924 | sdist = cic->last_request_pos - blk_rq_pos(rq); |
1925 | 1925 | ||
1926 | /* | 1926 | /* |
1927 | * Don't allow the seek distance to get too large from the | 1927 | * Don't allow the seek distance to get too large from the |
@@ -2071,7 +2071,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, | |||
2071 | cfq_update_io_seektime(cfqd, cic, rq); | 2071 | cfq_update_io_seektime(cfqd, cic, rq); |
2072 | cfq_update_idle_window(cfqd, cfqq, cic); | 2072 | cfq_update_idle_window(cfqd, cfqq, cic); |
2073 | 2073 | ||
2074 | cic->last_request_pos = rq->sector + rq->nr_sectors; | 2074 | cic->last_request_pos = blk_rq_pos(rq) + blk_rq_sectors(rq); |
2075 | 2075 | ||
2076 | if (cfqq == cfqd->active_queue) { | 2076 | if (cfqq == cfqd->active_queue) { |
2077 | /* | 2077 | /* |