diff options
Diffstat (limited to 'block/deadline-iosched.c')
-rw-r--r-- | block/deadline-iosched.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index 399fa1e60e1f..3bd0415a9828 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c | |||
@@ -613,24 +613,24 @@ static void deadline_exit_queue(elevator_t *e) | |||
613 | * initialize elevator private data (deadline_data), and alloc a drq for | 613 | * initialize elevator private data (deadline_data), and alloc a drq for |
614 | * each request on the free lists | 614 | * each request on the free lists |
615 | */ | 615 | */ |
616 | static int deadline_init_queue(request_queue_t *q, elevator_t *e) | 616 | static void *deadline_init_queue(request_queue_t *q, elevator_t *e) |
617 | { | 617 | { |
618 | struct deadline_data *dd; | 618 | struct deadline_data *dd; |
619 | int i; | 619 | int i; |
620 | 620 | ||
621 | if (!drq_pool) | 621 | if (!drq_pool) |
622 | return -ENOMEM; | 622 | return NULL; |
623 | 623 | ||
624 | dd = kmalloc_node(sizeof(*dd), GFP_KERNEL, q->node); | 624 | dd = kmalloc_node(sizeof(*dd), GFP_KERNEL, q->node); |
625 | if (!dd) | 625 | if (!dd) |
626 | return -ENOMEM; | 626 | return NULL; |
627 | memset(dd, 0, sizeof(*dd)); | 627 | memset(dd, 0, sizeof(*dd)); |
628 | 628 | ||
629 | dd->hash = kmalloc_node(sizeof(struct list_head)*DL_HASH_ENTRIES, | 629 | dd->hash = kmalloc_node(sizeof(struct list_head)*DL_HASH_ENTRIES, |
630 | GFP_KERNEL, q->node); | 630 | GFP_KERNEL, q->node); |
631 | if (!dd->hash) { | 631 | if (!dd->hash) { |
632 | kfree(dd); | 632 | kfree(dd); |
633 | return -ENOMEM; | 633 | return NULL; |
634 | } | 634 | } |
635 | 635 | ||
636 | dd->drq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, | 636 | dd->drq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, |
@@ -638,7 +638,7 @@ static int deadline_init_queue(request_queue_t *q, elevator_t *e) | |||
638 | if (!dd->drq_pool) { | 638 | if (!dd->drq_pool) { |
639 | kfree(dd->hash); | 639 | kfree(dd->hash); |
640 | kfree(dd); | 640 | kfree(dd); |
641 | return -ENOMEM; | 641 | return NULL; |
642 | } | 642 | } |
643 | 643 | ||
644 | for (i = 0; i < DL_HASH_ENTRIES; i++) | 644 | for (i = 0; i < DL_HASH_ENTRIES; i++) |
@@ -653,8 +653,7 @@ static int deadline_init_queue(request_queue_t *q, elevator_t *e) | |||
653 | dd->writes_starved = writes_starved; | 653 | dd->writes_starved = writes_starved; |
654 | dd->front_merges = 1; | 654 | dd->front_merges = 1; |
655 | dd->fifo_batch = fifo_batch; | 655 | dd->fifo_batch = fifo_batch; |
656 | e->elevator_data = dd; | 656 | return dd; |
657 | return 0; | ||
658 | } | 657 | } |
659 | 658 | ||
660 | static void deadline_put_request(request_queue_t *q, struct request *rq) | 659 | static void deadline_put_request(request_queue_t *q, struct request *rq) |