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/blk-merge.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/blk-merge.c')
-rw-r--r-- | block/blk-merge.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c index 23d2a6fe34a3..bf62a87a9da2 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -259,7 +259,7 @@ int ll_back_merge_fn(struct request_queue *q, struct request *req, | |||
259 | else | 259 | else |
260 | max_sectors = q->max_sectors; | 260 | max_sectors = q->max_sectors; |
261 | 261 | ||
262 | if (req->nr_sectors + bio_sectors(bio) > max_sectors) { | 262 | if (blk_rq_sectors(req) + bio_sectors(bio) > max_sectors) { |
263 | req->cmd_flags |= REQ_NOMERGE; | 263 | req->cmd_flags |= REQ_NOMERGE; |
264 | if (req == q->last_merge) | 264 | if (req == q->last_merge) |
265 | q->last_merge = NULL; | 265 | q->last_merge = NULL; |
@@ -284,7 +284,7 @@ int ll_front_merge_fn(struct request_queue *q, struct request *req, | |||
284 | max_sectors = q->max_sectors; | 284 | max_sectors = q->max_sectors; |
285 | 285 | ||
286 | 286 | ||
287 | if (req->nr_sectors + bio_sectors(bio) > max_sectors) { | 287 | if (blk_rq_sectors(req) + bio_sectors(bio) > max_sectors) { |
288 | req->cmd_flags |= REQ_NOMERGE; | 288 | req->cmd_flags |= REQ_NOMERGE; |
289 | if (req == q->last_merge) | 289 | if (req == q->last_merge) |
290 | q->last_merge = NULL; | 290 | q->last_merge = NULL; |
@@ -315,7 +315,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req, | |||
315 | /* | 315 | /* |
316 | * Will it become too large? | 316 | * Will it become too large? |
317 | */ | 317 | */ |
318 | if ((req->nr_sectors + next->nr_sectors) > q->max_sectors) | 318 | if ((blk_rq_sectors(req) + blk_rq_sectors(next)) > q->max_sectors) |
319 | return 0; | 319 | return 0; |
320 | 320 | ||
321 | total_phys_segments = req->nr_phys_segments + next->nr_phys_segments; | 321 | total_phys_segments = req->nr_phys_segments + next->nr_phys_segments; |
@@ -345,7 +345,7 @@ static void blk_account_io_merge(struct request *req) | |||
345 | int cpu; | 345 | int cpu; |
346 | 346 | ||
347 | cpu = part_stat_lock(); | 347 | cpu = part_stat_lock(); |
348 | part = disk_map_sector_rcu(req->rq_disk, req->sector); | 348 | part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req)); |
349 | 349 | ||
350 | part_round_stats(cpu, part); | 350 | part_round_stats(cpu, part); |
351 | part_dec_in_flight(part); | 351 | part_dec_in_flight(part); |
@@ -366,7 +366,7 @@ static int attempt_merge(struct request_queue *q, struct request *req, | |||
366 | /* | 366 | /* |
367 | * not contiguous | 367 | * not contiguous |
368 | */ | 368 | */ |
369 | if (req->sector + req->nr_sectors != next->sector) | 369 | if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next)) |
370 | return 0; | 370 | return 0; |
371 | 371 | ||
372 | if (rq_data_dir(req) != rq_data_dir(next) | 372 | if (rq_data_dir(req) != rq_data_dir(next) |