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 <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Tested-by: Grant Likely <[email protected]>
Acked-by: Grant Likely <[email protected]>
Tested-by: Adrian McMenamin <[email protected]>
Acked-by: Adrian McMenamin <[email protected]>
Acked-by: Mike Miller <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: Eric Moore <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: FUJITA Tomonori <[email protected]>
Cc: Pete Zaitcev <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Paul Clements <[email protected]>
Cc: Tim Waugh <[email protected]>
Cc: Jeff Garzik <[email protected]>
Cc: Jeremy Fitzhardinge <[email protected]>
Cc: Alex Dubov <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Dario Ballabio <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: unsik Kim <[email protected]>
Cc: Laurent Vivier <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Tejun Heo 2009-05-07 22:24:39 +09:00 • committed by Jens Axboe
commit 83096ebf12
54 changed files with 292 additions and 279 deletions

View file

@ -138,7 +138,7 @@ deadline_merge(struct request_queue *q, struct request **req, struct bio *bio)
__rq = elv_rb_find(&dd->sort_list[bio_data_dir(bio)], sector);
if (__rq) {
BUG_ON(sector != __rq->sector);
BUG_ON(sector != blk_rq_pos(__rq));
if (elv_rq_merge_ok(__rq, bio)) {
ret = ELEVATOR_FRONT_MERGE;