Lines Matching refs:rbdc
706 struct rbd_client *rbdc; in rbd_client_create() local
710 rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL); in rbd_client_create()
711 if (!rbdc) in rbd_client_create()
714 kref_init(&rbdc->kref); in rbd_client_create()
715 INIT_LIST_HEAD(&rbdc->node); in rbd_client_create()
717 rbdc->client = ceph_create_client(ceph_opts, rbdc); in rbd_client_create()
718 if (IS_ERR(rbdc->client)) in rbd_client_create()
722 ret = ceph_open_session(rbdc->client); in rbd_client_create()
727 list_add_tail(&rbdc->node, &rbd_client_list); in rbd_client_create()
730 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_create()
732 return rbdc; in rbd_client_create()
734 ceph_destroy_client(rbdc->client); in rbd_client_create()
736 kfree(rbdc); in rbd_client_create()
745 static struct rbd_client *__rbd_get_client(struct rbd_client *rbdc) in __rbd_get_client() argument
747 kref_get(&rbdc->kref); in __rbd_get_client()
749 return rbdc; in __rbd_get_client()
758 struct rbd_client *rbdc = NULL, *iter; in rbd_client_find() local
768 rbdc = iter; in rbd_client_find()
774 return rbdc; in rbd_client_find()
874 struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); in rbd_client_release() local
876 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_release()
878 list_del(&rbdc->node); in rbd_client_release()
881 ceph_destroy_client(rbdc->client); in rbd_client_release()
882 kfree(rbdc); in rbd_client_release()
889 static void rbd_put_client(struct rbd_client *rbdc) in rbd_put_client() argument
891 if (rbdc) in rbd_put_client()
892 kref_put(&rbdc->kref, rbd_client_release); in rbd_put_client()
902 struct rbd_client *rbdc; in rbd_get_client() local
906 rbdc = rbd_client_find(ceph_opts); in rbd_get_client()
907 if (rbdc) { in rbd_get_client()
914 ret = ceph_wait_for_latest_osdmap(rbdc->client, in rbd_get_client()
915 rbdc->client->options->mount_timeout); in rbd_get_client()
918 rbd_put_client(rbdc); in rbd_get_client()
919 rbdc = ERR_PTR(ret); in rbd_get_client()
922 rbdc = rbd_client_create(ceph_opts); in rbd_get_client()
926 return rbdc; in rbd_get_client()
5394 static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, in rbd_dev_create() argument
5420 rbd_dev->rbd_client = rbdc; in rbd_dev_create()
7085 struct rbd_client *rbdc; in do_rbd_add() local
7099 rbdc = rbd_get_client(ceph_opts); in do_rbd_add()
7100 if (IS_ERR(rbdc)) { in do_rbd_add()
7101 rc = PTR_ERR(rbdc); in do_rbd_add()
7106 rc = ceph_pg_poolid_by_name(rbdc->client->osdc.osdmap, spec->pool_name); in do_rbd_add()
7114 rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts); in do_rbd_add()
7119 rbdc = NULL; /* rbd_dev now owns this */ in do_rbd_add()
7184 rbd_put_client(rbdc); in do_rbd_add()