aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/as-iosched.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2005-10-20 10:46:54 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2005-10-28 02:45:35 -0400
commit98b11471d72a374f346bec50a00d0887719b85b3 (patch)
tree875feb99eacd983fdc9107eb1c3b68f24e641aa4 /drivers/block/as-iosched.c
parent06b86245c052963029bfd9020ca1f08ceb66f85a (diff)
[PATCH] 04/05 remove last_merge handling from ioscheds
Remove last_merge handling from all ioscheds. This patch removes merging capability of noop iosched. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/block/as-iosched.c')
-rw-r--r--drivers/block/as-iosched.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
index 1775ffe9edc7..5d20e4bcbc78 100644
--- a/drivers/block/as-iosched.c
+++ b/drivers/block/as-iosched.c
@@ -279,14 +279,6 @@ static inline void as_del_arq_hash(struct as_rq *arq)
279 __as_del_arq_hash(arq); 279 __as_del_arq_hash(arq);
280} 280}
281 281
282static void as_remove_merge_hints(request_queue_t *q, struct as_rq *arq)
283{
284 as_del_arq_hash(arq);
285
286 if (q->last_merge == arq->request)
287 q->last_merge = NULL;
288}
289
290static void as_add_arq_hash(struct as_data *ad, struct as_rq *arq) 282static void as_add_arq_hash(struct as_data *ad, struct as_rq *arq)
291{ 283{
292 struct request *rq = arq->request; 284 struct request *rq = arq->request;
@@ -330,7 +322,7 @@ static struct request *as_find_arq_hash(struct as_data *ad, sector_t offset)
330 BUG_ON(!arq->on_hash); 322 BUG_ON(!arq->on_hash);
331 323
332 if (!rq_mergeable(__rq)) { 324 if (!rq_mergeable(__rq)) {
333 as_remove_merge_hints(ad->q, arq); 325 as_del_arq_hash(arq);
334 continue; 326 continue;
335 } 327 }
336 328
@@ -1040,7 +1032,7 @@ static void as_remove_queued_request(request_queue_t *q, struct request *rq)
1040 ad->next_arq[data_dir] = as_find_next_arq(ad, arq); 1032 ad->next_arq[data_dir] = as_find_next_arq(ad, arq);
1041 1033
1042 list_del_init(&arq->fifo); 1034 list_del_init(&arq->fifo);
1043 as_remove_merge_hints(q, arq); 1035 as_del_arq_hash(arq);
1044 as_del_arq_rb(ad, arq); 1036 as_del_arq_rb(ad, arq);
1045} 1037}
1046 1038
@@ -1351,7 +1343,7 @@ as_add_aliased_request(struct as_data *ad, struct as_rq *arq, struct as_rq *alia
1351 /* 1343 /*
1352 * Don't want to have to handle merges. 1344 * Don't want to have to handle merges.
1353 */ 1345 */
1354 as_remove_merge_hints(ad->q, arq); 1346 as_del_arq_hash(arq);
1355} 1347}
1356 1348
1357/* 1349/*
@@ -1392,12 +1384,8 @@ static void as_add_request(request_queue_t *q, struct request *rq)
1392 arq->expires = jiffies + ad->fifo_expire[data_dir]; 1384 arq->expires = jiffies + ad->fifo_expire[data_dir];
1393 list_add_tail(&arq->fifo, &ad->fifo_list[data_dir]); 1385 list_add_tail(&arq->fifo, &ad->fifo_list[data_dir]);
1394 1386
1395 if (rq_mergeable(arq->request)) { 1387 if (rq_mergeable(arq->request))
1396 as_add_arq_hash(ad, arq); 1388 as_add_arq_hash(ad, arq);
1397
1398 if (!ad->q->last_merge)
1399 ad->q->last_merge = arq->request;
1400 }
1401 as_update_arq(ad, arq); /* keep state machine up to date */ 1389 as_update_arq(ad, arq); /* keep state machine up to date */
1402 1390
1403 } else { 1391 } else {
@@ -1487,15 +1475,6 @@ as_merge(request_queue_t *q, struct request **req, struct bio *bio)
1487 int ret; 1475 int ret;
1488 1476
1489 /* 1477 /*
1490 * try last_merge to avoid going to hash
1491 */
1492 ret = elv_try_last_merge(q, bio);
1493 if (ret != ELEVATOR_NO_MERGE) {
1494 __rq = q->last_merge;
1495 goto out_insert;
1496 }
1497
1498 /*
1499 * see if the merge hash can satisfy a back merge 1478 * see if the merge hash can satisfy a back merge
1500 */ 1479 */
1501 __rq = as_find_arq_hash(ad, bio->bi_sector); 1480 __rq = as_find_arq_hash(ad, bio->bi_sector);
@@ -1523,9 +1502,6 @@ as_merge(request_queue_t *q, struct request **req, struct bio *bio)
1523 1502
1524 return ELEVATOR_NO_MERGE; 1503 return ELEVATOR_NO_MERGE;
1525out: 1504out:
1526 if (rq_mergeable(__rq))
1527 q->last_merge = __rq;
1528out_insert:
1529 if (ret) { 1505 if (ret) {
1530 if (rq_mergeable(__rq)) 1506 if (rq_mergeable(__rq))
1531 as_hot_arq_hash(ad, RQ_DATA(__rq)); 1507 as_hot_arq_hash(ad, RQ_DATA(__rq));
@@ -1572,9 +1548,6 @@ static void as_merged_request(request_queue_t *q, struct request *req)
1572 * behind the disk head. We currently don't bother adjusting. 1548 * behind the disk head. We currently don't bother adjusting.
1573 */ 1549 */
1574 } 1550 }
1575
1576 if (arq->on_hash)
1577 q->last_merge = req;
1578} 1551}
1579 1552
1580static void 1553static void