Lines Matching refs:rbdc

707 	struct rbd_client *rbdc;  in rbd_client_create()  local
711 rbdc = kmalloc(sizeof(struct rbd_client), GFP_KERNEL); in rbd_client_create()
712 if (!rbdc) in rbd_client_create()
715 kref_init(&rbdc->kref); in rbd_client_create()
716 INIT_LIST_HEAD(&rbdc->node); in rbd_client_create()
718 rbdc->client = ceph_create_client(ceph_opts, rbdc); in rbd_client_create()
719 if (IS_ERR(rbdc->client)) in rbd_client_create()
723 ret = ceph_open_session(rbdc->client); in rbd_client_create()
728 list_add_tail(&rbdc->node, &rbd_client_list); in rbd_client_create()
731 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_create()
733 return rbdc; in rbd_client_create()
735 ceph_destroy_client(rbdc->client); in rbd_client_create()
737 kfree(rbdc); in rbd_client_create()
746 static struct rbd_client *__rbd_get_client(struct rbd_client *rbdc) in __rbd_get_client() argument
748 kref_get(&rbdc->kref); in __rbd_get_client()
750 return rbdc; in __rbd_get_client()
759 struct rbd_client *rbdc = NULL, *iter; in rbd_client_find() local
769 rbdc = iter; in rbd_client_find()
775 return rbdc; in rbd_client_find()
875 struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); in rbd_client_release() local
877 dout("%s: rbdc %p\n", __func__, rbdc); in rbd_client_release()
879 list_del(&rbdc->node); in rbd_client_release()
882 ceph_destroy_client(rbdc->client); in rbd_client_release()
883 kfree(rbdc); in rbd_client_release()
890 static void rbd_put_client(struct rbd_client *rbdc) in rbd_put_client() argument
892 if (rbdc) in rbd_put_client()
893 kref_put(&rbdc->kref, rbd_client_release); in rbd_put_client()
903 struct rbd_client *rbdc; in rbd_get_client() local
907 rbdc = rbd_client_find(ceph_opts); in rbd_get_client()
908 if (rbdc) { in rbd_get_client()
915 ret = ceph_wait_for_latest_osdmap(rbdc->client, in rbd_get_client()
916 rbdc->client->options->mount_timeout); in rbd_get_client()
919 rbd_put_client(rbdc); in rbd_get_client()
920 rbdc = ERR_PTR(ret); in rbd_get_client()
923 rbdc = rbd_client_create(ceph_opts); in rbd_get_client()
927 return rbdc; in rbd_get_client()
5295 static struct rbd_device *__rbd_dev_create(struct rbd_client *rbdc, in __rbd_dev_create() argument
5341 rbd_dev->rbd_client = rbdc; in __rbd_dev_create()
5350 static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, in rbd_dev_create() argument
5356 rbd_dev = __rbd_dev_create(rbdc, spec); in rbd_dev_create()
6981 struct rbd_client *rbdc; in do_rbd_add() local
6995 rbdc = rbd_get_client(ceph_opts); in do_rbd_add()
6996 if (IS_ERR(rbdc)) { in do_rbd_add()
6997 rc = PTR_ERR(rbdc); in do_rbd_add()
7002 rc = ceph_pg_poolid_by_name(rbdc->client->osdc.osdmap, spec->pool_name); in do_rbd_add()
7010 rbd_dev = rbd_dev_create(rbdc, spec, rbd_opts); in do_rbd_add()
7015 rbdc = NULL; /* rbd_dev now owns this */ in do_rbd_add()
7080 rbd_put_client(rbdc); in do_rbd_add()