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 06962d8402a3..c94de8e12fbf 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c | |||
@@ -612,24 +612,24 @@ static void deadline_exit_queue(elevator_t *e) | |||
612 | * initialize elevator private data (deadline_data), and alloc a drq for | 612 | * initialize elevator private data (deadline_data), and alloc a drq for |
613 | * each request on the free lists | 613 | * each request on the free lists |
614 | */ | 614 | */ |
615 | static int deadline_init_queue(request_queue_t *q, elevator_t *e) | 615 | static void *deadline_init_queue(request_queue_t *q, elevator_t *e) |
616 | { | 616 | { |
617 | struct deadline_data *dd; | 617 | struct deadline_data *dd; |
618 | int i; | 618 | int i; |
619 | 619 | ||
620 | if (!drq_pool) | 620 | if (!drq_pool) |
621 | return -ENOMEM; | 621 | return NULL; |
622 | 622 | ||
623 | dd = kmalloc_node(sizeof(*dd), GFP_KERNEL, q->node); | 623 | dd = kmalloc_node(sizeof(*dd), GFP_KERNEL, q->node); |
624 | if (!dd) | 624 | if (!dd) |
625 | return -ENOMEM; | 625 | return NULL; |
626 | memset(dd, 0, sizeof(*dd)); | 626 | memset(dd, 0, sizeof(*dd)); |
627 | 627 | ||
628 | dd->hash = kmalloc_node(sizeof(struct list_head)*DL_HASH_ENTRIES, | 628 | dd->hash = kmalloc_node(sizeof(struct list_head)*DL_HASH_ENTRIES, |
629 | GFP_KERNEL, q->node); | 629 | GFP_KERNEL, q->node); |
630 | if (!dd->hash) { | 630 | if (!dd->hash) { |
631 | kfree(dd); | 631 | kfree(dd); |
632 | return -ENOMEM; | 632 | return NULL; |
633 | } | 633 | } |
634 | 634 | ||
635 | dd->drq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, | 635 | dd->drq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab, |
@@ -637,7 +637,7 @@ static int deadline_init_queue(request_queue_t *q, elevator_t *e) | |||
637 | if (!dd->drq_pool) { | 637 | if (!dd->drq_pool) { |
638 | kfree(dd->hash); | 638 | kfree(dd->hash); |
639 | kfree(dd); | 639 | kfree(dd); |
640 | return -ENOMEM; | 640 | return NULL; |
641 | } | 641 | } |
642 | 642 | ||
643 | for (i = 0; i < DL_HASH_ENTRIES; i++) | 643 | for (i = 0; i < DL_HASH_ENTRIES; i++) |
@@ -652,8 +652,7 @@ static int deadline_init_queue(request_queue_t *q, elevator_t *e) | |||
652 | dd->writes_starved = writes_starved; | 652 | dd->writes_starved = writes_starved; |
653 | dd->front_merges = 1; | 653 | dd->front_merges = 1; |
654 | dd->fifo_batch = fifo_batch; | 654 | dd->fifo_batch = fifo_batch; |
655 | e->elevator_data = dd; | 655 | return dd; |
656 | return 0; | ||
657 | } | 656 | } |
658 | 657 | ||
659 | static void deadline_put_request(request_queue_t *q, struct request *rq) | 658 | static void deadline_put_request(request_queue_t *q, struct request *rq) |