Lines Matching refs:rbdc

657 	struct rbd_client *rbdc;  in rbd_client_create()  local
661 rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL); in rbd_client_create()
662 if (!rbdc) in rbd_client_create()
665 kref_init(&rbdc->kref); in rbd_client_create()
666 INIT_LIST_HEAD(&rbdc->node); in rbd_client_create()
668 rbdc->client = ceph_create_client(ceph_opts, rbdc, 0, 0); in rbd_client_create()
669 if (IS_ERR(rbdc->client)) in rbd_client_create()
673 ret = ceph_open_session(rbdc->client); in rbd_client_create()
678 list_add_tail(&rbdc->node, &rbd_client_list); in rbd_client_create()
681 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_create()
683 return rbdc; in rbd_client_create()
685 ceph_destroy_client(rbdc->client); in rbd_client_create()
687 kfree(rbdc); in rbd_client_create()
696 static struct rbd_client *__rbd_get_client(struct rbd_client *rbdc) in __rbd_get_client() argument
698 kref_get(&rbdc->kref); in __rbd_get_client()
700 return rbdc; in __rbd_get_client()
822 struct rbd_client *rbdc; in rbd_get_client() local
825 rbdc = rbd_client_find(ceph_opts); in rbd_get_client()
826 if (rbdc) /* using an existing client */ in rbd_get_client()
829 rbdc = rbd_client_create(ceph_opts); in rbd_get_client()
832 return rbdc; in rbd_get_client()
842 struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); in rbd_client_release() local
844 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_release()
846 list_del(&rbdc->node); in rbd_client_release()
849 ceph_destroy_client(rbdc->client); in rbd_client_release()
850 kfree(rbdc); in rbd_client_release()
857 static void rbd_put_client(struct rbd_client *rbdc) in rbd_put_client() argument
859 if (rbdc) in rbd_put_client()
860 kref_put(&rbdc->kref, rbd_client_release); in rbd_put_client()
4064 static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, in rbd_dev_create() argument
4080 rbd_dev->rbd_client = rbdc; in rbd_dev_create()
4982 static int rbd_add_get_pool_id(struct rbd_client *rbdc, const char *pool_name) in rbd_add_get_pool_id() argument
4985 unsigned long timeout = rbdc->client->options->mount_timeout * HZ; in rbd_add_get_pool_id()
4990 ret = ceph_pg_poolid_by_name(rbdc->client->osdc.osdmap, pool_name); in rbd_add_get_pool_id()
4992 ret = ceph_monc_do_get_version(&rbdc->client->monc, "osdmap", in rbd_add_get_pool_id()
4997 if (rbdc->client->osdc.osdmap->epoch < newest_epoch) { in rbd_add_get_pool_id()
4998 ceph_monc_request_next_osdmap(&rbdc->client->monc); in rbd_add_get_pool_id()
4999 (void) ceph_monc_wait_osdmap(&rbdc->client->monc, in rbd_add_get_pool_id()
5409 struct rbd_client *rbdc; in do_rbd_add() local
5424 rbdc = rbd_get_client(ceph_opts); in do_rbd_add()
5425 if (IS_ERR(rbdc)) { in do_rbd_add()
5426 rc = PTR_ERR(rbdc); in do_rbd_add()
5431 rc = rbd_add_get_pool_id(rbdc, spec->pool_name); in do_rbd_add()
5448 rbd_dev = rbd_dev_create(rbdc, spec); in do_rbd_add()
5451 rbdc = NULL; /* rbd_dev now owns this */ in do_rbd_add()
5481 rbd_put_client(rbdc); in do_rbd_add()