aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 8e9d84825e1c..a46d030e092a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2251,14 +2251,14 @@ static void cfq_exit_queue(elevator_t *e)
2251 kfree(cfqd); 2251 kfree(cfqd);
2252} 2252}
2253 2253
2254static int cfq_init_queue(request_queue_t *q, elevator_t *e) 2254static void *cfq_init_queue(request_queue_t *q, elevator_t *e)
2255{ 2255{
2256 struct cfq_data *cfqd; 2256 struct cfq_data *cfqd;
2257 int i; 2257 int i;
2258 2258
2259 cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL); 2259 cfqd = kmalloc(sizeof(*cfqd), GFP_KERNEL);
2260 if (!cfqd) 2260 if (!cfqd)
2261 return -ENOMEM; 2261 return NULL;
2262 2262
2263 memset(cfqd, 0, sizeof(*cfqd)); 2263 memset(cfqd, 0, sizeof(*cfqd));
2264 2264
@@ -2288,8 +2288,6 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
2288 for (i = 0; i < CFQ_QHASH_ENTRIES; i++) 2288 for (i = 0; i < CFQ_QHASH_ENTRIES; i++)
2289 INIT_HLIST_HEAD(&cfqd->cfq_hash[i]); 2289 INIT_HLIST_HEAD(&cfqd->cfq_hash[i]);
2290 2290
2291 e->elevator_data = cfqd;
2292
2293 cfqd->queue = q; 2291 cfqd->queue = q;
2294 2292
2295 cfqd->max_queued = q->nr_requests / 4; 2293 cfqd->max_queued = q->nr_requests / 4;
@@ -2316,14 +2314,14 @@ static int cfq_init_queue(request_queue_t *q, elevator_t *e)
2316 cfqd->cfq_slice_async_rq = cfq_slice_async_rq; 2314 cfqd->cfq_slice_async_rq = cfq_slice_async_rq;
2317 cfqd->cfq_slice_idle = cfq_slice_idle; 2315 cfqd->cfq_slice_idle = cfq_slice_idle;
2318 2316
2319 return 0; 2317 return cfqd;
2320out_crqpool: 2318out_crqpool:
2321 kfree(cfqd->cfq_hash); 2319 kfree(cfqd->cfq_hash);
2322out_cfqhash: 2320out_cfqhash:
2323 kfree(cfqd->crq_hash); 2321 kfree(cfqd->crq_hash);
2324out_crqhash: 2322out_crqhash:
2325 kfree(cfqd); 2323 kfree(cfqd);
2326 return -ENOMEM; 2324 return NULL;
2327} 2325}
2328 2326
2329static void cfq_slab_kill(void) 2327static void cfq_slab_kill(void)