diff options
Diffstat (limited to 'block/as-iosched.c')
-rw-r--r-- | block/as-iosched.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c index 45bd07059c28..7a12cf6ee1d3 100644 --- a/block/as-iosched.c +++ b/block/as-iosched.c | |||
@@ -306,8 +306,8 @@ as_choose_req(struct as_data *ad, struct request *rq1, struct request *rq2) | |||
306 | data_dir = rq_is_sync(rq1); | 306 | data_dir = rq_is_sync(rq1); |
307 | 307 | ||
308 | last = ad->last_sector[data_dir]; | 308 | last = ad->last_sector[data_dir]; |
309 | s1 = rq1->sector; | 309 | s1 = blk_rq_pos(rq1); |
310 | s2 = rq2->sector; | 310 | s2 = blk_rq_pos(rq2); |
311 | 311 | ||
312 | BUG_ON(data_dir != rq_is_sync(rq2)); | 312 | BUG_ON(data_dir != rq_is_sync(rq2)); |
313 | 313 | ||
@@ -566,13 +566,15 @@ static void as_update_iohist(struct as_data *ad, struct as_io_context *aic, | |||
566 | as_update_thinktime(ad, aic, thinktime); | 566 | as_update_thinktime(ad, aic, thinktime); |
567 | 567 | ||
568 | /* Calculate read -> read seek distance */ | 568 | /* Calculate read -> read seek distance */ |
569 | if (aic->last_request_pos < rq->sector) | 569 | if (aic->last_request_pos < blk_rq_pos(rq)) |
570 | seek_dist = rq->sector - aic->last_request_pos; | 570 | seek_dist = blk_rq_pos(rq) - |
571 | aic->last_request_pos; | ||
571 | else | 572 | else |
572 | seek_dist = aic->last_request_pos - rq->sector; | 573 | seek_dist = aic->last_request_pos - |
574 | blk_rq_pos(rq); | ||
573 | as_update_seekdist(ad, aic, seek_dist); | 575 | as_update_seekdist(ad, aic, seek_dist); |
574 | } | 576 | } |
575 | aic->last_request_pos = rq->sector + rq->nr_sectors; | 577 | aic->last_request_pos = blk_rq_pos(rq) + blk_rq_sectors(rq); |
576 | set_bit(AS_TASK_IOSTARTED, &aic->state); | 578 | set_bit(AS_TASK_IOSTARTED, &aic->state); |
577 | spin_unlock(&aic->lock); | 579 | spin_unlock(&aic->lock); |
578 | } | 580 | } |
@@ -587,7 +589,7 @@ static int as_close_req(struct as_data *ad, struct as_io_context *aic, | |||
587 | { | 589 | { |
588 | unsigned long delay; /* jiffies */ | 590 | unsigned long delay; /* jiffies */ |
589 | sector_t last = ad->last_sector[ad->batch_data_dir]; | 591 | sector_t last = ad->last_sector[ad->batch_data_dir]; |
590 | sector_t next = rq->sector; | 592 | sector_t next = blk_rq_pos(rq); |
591 | sector_t delta; /* acceptable close offset (in sectors) */ | 593 | sector_t delta; /* acceptable close offset (in sectors) */ |
592 | sector_t s; | 594 | sector_t s; |
593 | 595 | ||
@@ -981,7 +983,7 @@ static void as_move_to_dispatch(struct as_data *ad, struct request *rq) | |||
981 | * This has to be set in order to be correctly updated by | 983 | * This has to be set in order to be correctly updated by |
982 | * as_find_next_rq | 984 | * as_find_next_rq |
983 | */ | 985 | */ |
984 | ad->last_sector[data_dir] = rq->sector + rq->nr_sectors; | 986 | ad->last_sector[data_dir] = blk_rq_pos(rq) + blk_rq_sectors(rq); |
985 | 987 | ||
986 | if (data_dir == BLK_RW_SYNC) { | 988 | if (data_dir == BLK_RW_SYNC) { |
987 | struct io_context *ioc = RQ_IOC(rq); | 989 | struct io_context *ioc = RQ_IOC(rq); |