Lines Matching refs:rbdc

656 	struct rbd_client *rbdc;  in rbd_client_create()  local
660 rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL); in rbd_client_create()
661 if (!rbdc) in rbd_client_create()
664 kref_init(&rbdc->kref); in rbd_client_create()
665 INIT_LIST_HEAD(&rbdc->node); in rbd_client_create()
667 rbdc->client = ceph_create_client(ceph_opts, rbdc, 0, 0); in rbd_client_create()
668 if (IS_ERR(rbdc->client)) in rbd_client_create()
672 ret = ceph_open_session(rbdc->client); in rbd_client_create()
677 list_add_tail(&rbdc->node, &rbd_client_list); in rbd_client_create()
680 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_create()
682 return rbdc; in rbd_client_create()
684 ceph_destroy_client(rbdc->client); in rbd_client_create()
686 kfree(rbdc); in rbd_client_create()
695 static struct rbd_client *__rbd_get_client(struct rbd_client *rbdc) in __rbd_get_client() argument
697 kref_get(&rbdc->kref); in __rbd_get_client()
699 return rbdc; in __rbd_get_client()
824 struct rbd_client *rbdc; in rbd_get_client() local
827 rbdc = rbd_client_find(ceph_opts); in rbd_get_client()
828 if (rbdc) /* using an existing client */ in rbd_get_client()
831 rbdc = rbd_client_create(ceph_opts); in rbd_get_client()
834 return rbdc; in rbd_get_client()
844 struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); in rbd_client_release() local
846 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_release()
848 list_del(&rbdc->node); in rbd_client_release()
851 ceph_destroy_client(rbdc->client); in rbd_client_release()
852 kfree(rbdc); in rbd_client_release()
859 static void rbd_put_client(struct rbd_client *rbdc) in rbd_put_client() argument
861 if (rbdc) in rbd_put_client()
862 kref_put(&rbdc->kref, rbd_client_release); in rbd_put_client()
4060 static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, in rbd_dev_create() argument
4081 rbd_dev->rbd_client = rbdc; in rbd_dev_create()
4975 static int rbd_add_get_pool_id(struct rbd_client *rbdc, const char *pool_name) in rbd_add_get_pool_id() argument
4977 struct ceph_options *opts = rbdc->client->options; in rbd_add_get_pool_id()
4983 ret = ceph_pg_poolid_by_name(rbdc->client->osdc.osdmap, pool_name); in rbd_add_get_pool_id()
4985 ret = ceph_monc_do_get_version(&rbdc->client->monc, "osdmap", in rbd_add_get_pool_id()
4990 if (rbdc->client->osdc.osdmap->epoch < newest_epoch) { in rbd_add_get_pool_id()
4991 ceph_monc_request_next_osdmap(&rbdc->client->monc); in rbd_add_get_pool_id()
4992 (void) ceph_monc_wait_osdmap(&rbdc->client->monc, in rbd_add_get_pool_id()
5403 struct rbd_client *rbdc; in do_rbd_add() local
5415 rbdc = rbd_get_client(ceph_opts); in do_rbd_add()
5416 if (IS_ERR(rbdc)) { in do_rbd_add()
5417 rc = PTR_ERR(rbdc); in do_rbd_add()
5422 rc = rbd_add_get_pool_id(rbdc, spec->pool_name); in do_rbd_add()
5439 rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts); in do_rbd_add()
5444 rbdc = NULL; /* rbd_dev now owns this */ in do_rbd_add()
5479 rbd_put_client(rbdc); in do_rbd_add()