diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2011-05-29 08:03:13 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-05-29 08:03:13 -0400 |
commit | fa34ce73072f90ecd90dcc43f29d82e70e5f8676 (patch) | |
tree | 26f9c986da4433fa8ed00a1685e34709997474b2 /drivers/md/dm-kcopyd.c | |
parent | 5f43ba2950414dc0abf4ac44c397d88069056746 (diff) |
dm kcopyd: return client directly and not through a pointer
Return client directly from dm_kcopyd_client_create, not through a
parameter, making it consistent with dm_io_client_create.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-kcopyd.c')
-rw-r--r-- | drivers/md/dm-kcopyd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index 579647f8b4d2..819e37eaaeba 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c | |||
@@ -637,14 +637,14 @@ int kcopyd_cancel(struct kcopyd_job *job, int block) | |||
637 | /*----------------------------------------------------------------- | 637 | /*----------------------------------------------------------------- |
638 | * Client setup | 638 | * Client setup |
639 | *---------------------------------------------------------------*/ | 639 | *---------------------------------------------------------------*/ |
640 | int dm_kcopyd_client_create(struct dm_kcopyd_client **result) | 640 | struct dm_kcopyd_client *dm_kcopyd_client_create(void) |
641 | { | 641 | { |
642 | int r = -ENOMEM; | 642 | int r = -ENOMEM; |
643 | struct dm_kcopyd_client *kc; | 643 | struct dm_kcopyd_client *kc; |
644 | 644 | ||
645 | kc = kmalloc(sizeof(*kc), GFP_KERNEL); | 645 | kc = kmalloc(sizeof(*kc), GFP_KERNEL); |
646 | if (!kc) | 646 | if (!kc) |
647 | return -ENOMEM; | 647 | return ERR_PTR(-ENOMEM); |
648 | 648 | ||
649 | spin_lock_init(&kc->job_lock); | 649 | spin_lock_init(&kc->job_lock); |
650 | INIT_LIST_HEAD(&kc->complete_jobs); | 650 | INIT_LIST_HEAD(&kc->complete_jobs); |
@@ -676,8 +676,7 @@ int dm_kcopyd_client_create(struct dm_kcopyd_client **result) | |||
676 | init_waitqueue_head(&kc->destroyq); | 676 | init_waitqueue_head(&kc->destroyq); |
677 | atomic_set(&kc->nr_jobs, 0); | 677 | atomic_set(&kc->nr_jobs, 0); |
678 | 678 | ||
679 | *result = kc; | 679 | return kc; |
680 | return 0; | ||
681 | 680 | ||
682 | bad_io_client: | 681 | bad_io_client: |
683 | client_free_pages(kc); | 682 | client_free_pages(kc); |
@@ -688,7 +687,7 @@ bad_workqueue: | |||
688 | bad_slab: | 687 | bad_slab: |
689 | kfree(kc); | 688 | kfree(kc); |
690 | 689 | ||
691 | return r; | 690 | return ERR_PTR(r); |
692 | } | 691 | } |
693 | EXPORT_SYMBOL(dm_kcopyd_client_create); | 692 | EXPORT_SYMBOL(dm_kcopyd_client_create); |
694 | 693 | ||