aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-18 18:08:44 -0500
committerSage Weil <sage@newdream.net>2009-11-18 19:20:08 -0500
commitb9bfb93ce2b1ef668254f0b9e16fcc5246d65d8e (patch)
tree77f3c99bd497137297fed7f0f2ba8967d4181bec /fs/ceph
parent4e7a5dcd1bbab6560fbc8ada29a840e7a20ed7bc (diff)
ceph: move mempool creation to ceph_create_client
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/super.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index c901395ae8a1..df05617aca86 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -534,10 +534,18 @@ static struct ceph_client *ceph_create_client(struct ceph_mount_args *args)
534 if (client->trunc_wq == NULL) 534 if (client->trunc_wq == NULL)
535 goto fail_pg_inv_wq; 535 goto fail_pg_inv_wq;
536 536
537 /* set up mempools */
538 err = -ENOMEM;
539 client->wb_pagevec_pool = mempool_create_kmalloc_pool(10,
540 client->mount_args->wsize >> PAGE_CACHE_SHIFT);
541 if (!client->wb_pagevec_pool)
542 goto fail_trunc_wq;
543
544
537 /* subsystems */ 545 /* subsystems */
538 err = ceph_monc_init(&client->monc, client); 546 err = ceph_monc_init(&client->monc, client);
539 if (err < 0) 547 if (err < 0)
540 goto fail_trunc_wq; 548 goto fail_mempool;
541 err = ceph_osdc_init(&client->osdc, client); 549 err = ceph_osdc_init(&client->osdc, client);
542 if (err < 0) 550 if (err < 0)
543 goto fail_monc; 551 goto fail_monc;
@@ -550,6 +558,8 @@ fail_osdc:
550 ceph_osdc_stop(&client->osdc); 558 ceph_osdc_stop(&client->osdc);
551fail_monc: 559fail_monc:
552 ceph_monc_stop(&client->monc); 560 ceph_monc_stop(&client->monc);
561fail_mempool:
562 mempool_destroy(client->wb_pagevec_pool);
553fail_trunc_wq: 563fail_trunc_wq:
554 destroy_workqueue(client->trunc_wq); 564 destroy_workqueue(client->trunc_wq);
555fail_pg_inv_wq: 565fail_pg_inv_wq:
@@ -581,8 +591,7 @@ static void ceph_destroy_client(struct ceph_client *client)
581 591
582 if (client->msgr) 592 if (client->msgr)
583 ceph_messenger_destroy(client->msgr); 593 ceph_messenger_destroy(client->msgr);
584 if (client->wb_pagevec_pool) 594 mempool_destroy(client->wb_pagevec_pool);
585 mempool_destroy(client->wb_pagevec_pool);
586 595
587 destroy_mount_args(client->mount_args); 596 destroy_mount_args(client->mount_args);
588 597
@@ -845,14 +854,6 @@ static int ceph_get_sb(struct file_system_type *fs_type,
845 dout("get_sb got existing client %p\n", client); 854 dout("get_sb got existing client %p\n", client);
846 } else { 855 } else {
847 dout("get_sb using new client %p\n", client); 856 dout("get_sb using new client %p\n", client);
848
849 /* set up mempools */
850 err = -ENOMEM;
851 client->wb_pagevec_pool = mempool_create_kmalloc_pool(10,
852 client->mount_args->wsize >> PAGE_CACHE_SHIFT);
853 if (!client->wb_pagevec_pool)
854 goto out_splat;
855
856 err = ceph_register_bdi(sb, client); 857 err = ceph_register_bdi(sb, client);
857 if (err < 0) 858 if (err < 0)
858 goto out_splat; 859 goto out_splat;