aboutsummaryrefslogtreecommitdiffstats
path: root/block/as-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/as-iosched.c')
-rw-r--r--block/as-iosched.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c
index ed336ab453ba..0c750393be4a 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -1647,17 +1647,17 @@ static void as_exit_queue(elevator_t *e)
1647 * initialize elevator private data (as_data), and alloc a arq for 1647 * initialize elevator private data (as_data), and alloc a arq for
1648 * each request on the free lists 1648 * each request on the free lists
1649 */ 1649 */
1650static int as_init_queue(request_queue_t *q, elevator_t *e) 1650static void *as_init_queue(request_queue_t *q, elevator_t *e)
1651{ 1651{
1652 struct as_data *ad; 1652 struct as_data *ad;
1653 int i; 1653 int i;
1654 1654
1655 if (!arq_pool) 1655 if (!arq_pool)
1656 return -ENOMEM; 1656 return NULL;
1657 1657
1658 ad = kmalloc_node(sizeof(*ad), GFP_KERNEL, q->node); 1658 ad = kmalloc_node(sizeof(*ad), GFP_KERNEL, q->node);
1659 if (!ad) 1659 if (!ad)
1660 return -ENOMEM; 1660 return NULL;
1661 memset(ad, 0, sizeof(*ad)); 1661 memset(ad, 0, sizeof(*ad));
1662 1662
1663 ad->q = q; /* Identify what queue the data belongs to */ 1663 ad->q = q; /* Identify what queue the data belongs to */
@@ -1666,7 +1666,7 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
1666 GFP_KERNEL, q->node); 1666 GFP_KERNEL, q->node);
1667 if (!ad->hash) { 1667 if (!ad->hash) {
1668 kfree(ad); 1668 kfree(ad);
1669 return -ENOMEM; 1669 return NULL;
1670 } 1670 }
1671 1671
1672 ad->arq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, 1672 ad->arq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab,
@@ -1674,7 +1674,7 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
1674 if (!ad->arq_pool) { 1674 if (!ad->arq_pool) {
1675 kfree(ad->hash); 1675 kfree(ad->hash);
1676 kfree(ad); 1676 kfree(ad);
1677 return -ENOMEM; 1677 return NULL;
1678 } 1678 }
1679 1679
1680 /* anticipatory scheduling helpers */ 1680 /* anticipatory scheduling helpers */
@@ -1695,14 +1695,13 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
1695 ad->antic_expire = default_antic_expire; 1695 ad->antic_expire = default_antic_expire;
1696 ad->batch_expire[REQ_SYNC] = default_read_batch_expire; 1696 ad->batch_expire[REQ_SYNC] = default_read_batch_expire;
1697 ad->batch_expire[REQ_ASYNC] = default_write_batch_expire; 1697 ad->batch_expire[REQ_ASYNC] = default_write_batch_expire;
1698 e->elevator_data = ad;
1699 1698
1700 ad->current_batch_expires = jiffies + ad->batch_expire[REQ_SYNC]; 1699 ad->current_batch_expires = jiffies + ad->batch_expire[REQ_SYNC];
1701 ad->write_batch_count = ad->batch_expire[REQ_ASYNC] / 10; 1700 ad->write_batch_count = ad->batch_expire[REQ_ASYNC] / 10;
1702 if (ad->write_batch_count < 2) 1701 if (ad->write_batch_count < 2)
1703 ad->write_batch_count = 2; 1702 ad->write_batch_count = 2;
1704 1703
1705 return 0; 1704 return ad;
1706} 1705}
1707 1706
1708/* 1707/*