Lines Matching refs:client

105 int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)  in ceph_check_fsid()  argument
107 if (client->have_fsid) { in ceph_check_fsid()
108 if (ceph_fsid_compare(&client->fsid, fsid)) { in ceph_check_fsid()
110 &client->fsid, fsid); in ceph_check_fsid()
114 memcpy(&client->fsid, fsid, sizeof(*fsid)); in ceph_check_fsid()
132 struct ceph_client *client) in ceph_compare_options() argument
135 struct ceph_options *opt2 = client->options; in ceph_compare_options()
144 if (!net_eq(current->nsproxy->net_ns, read_pnet(&client->msgr.net))) in ceph_compare_options()
185 if (ceph_monmap_contains(client->monc.monmap, in ceph_compare_options()
604 int ceph_print_client_options(struct seq_file *m, struct ceph_client *client, in ceph_print_client_options() argument
607 struct ceph_options *opt = client->options; in ceph_print_client_options()
692 struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client) in ceph_client_addr() argument
694 return &client->msgr.inst.addr; in ceph_client_addr()
698 u64 ceph_client_gid(struct ceph_client *client) in ceph_client_gid() argument
700 return client->monc.auth->global_id; in ceph_client_gid()
709 struct ceph_client *client; in ceph_create_client() local
717 client = kzalloc(sizeof(*client), GFP_KERNEL); in ceph_create_client()
718 if (client == NULL) in ceph_create_client()
721 client->private = private; in ceph_create_client()
722 client->options = opt; in ceph_create_client()
724 mutex_init(&client->mount_mutex); in ceph_create_client()
725 init_waitqueue_head(&client->auth_wq); in ceph_create_client()
726 client->auth_err = 0; in ceph_create_client()
728 client->extra_mon_dispatch = NULL; in ceph_create_client()
729 client->supported_features = CEPH_FEATURES_SUPPORTED_DEFAULT; in ceph_create_client()
730 client->required_features = CEPH_FEATURES_REQUIRED_DEFAULT; in ceph_create_client()
732 if (!ceph_test_opt(client, NOMSGSIGN)) in ceph_create_client()
733 client->required_features |= CEPH_FEATURE_MSG_AUTH; in ceph_create_client()
736 if (ceph_test_opt(client, MYIP)) in ceph_create_client()
737 myaddr = &client->options->my_addr; in ceph_create_client()
739 ceph_messenger_init(&client->msgr, myaddr); in ceph_create_client()
742 err = ceph_monc_init(&client->monc, client); in ceph_create_client()
745 err = ceph_osdc_init(&client->osdc, client); in ceph_create_client()
749 return client; in ceph_create_client()
752 ceph_monc_stop(&client->monc); in ceph_create_client()
754 ceph_messenger_fini(&client->msgr); in ceph_create_client()
755 kfree(client); in ceph_create_client()
760 void ceph_destroy_client(struct ceph_client *client) in ceph_destroy_client() argument
762 dout("destroy_client %p\n", client); in ceph_destroy_client()
764 atomic_set(&client->msgr.stopping, 1); in ceph_destroy_client()
767 ceph_osdc_stop(&client->osdc); in ceph_destroy_client()
768 ceph_monc_stop(&client->monc); in ceph_destroy_client()
769 ceph_messenger_fini(&client->msgr); in ceph_destroy_client()
771 ceph_debugfs_client_cleanup(client); in ceph_destroy_client()
773 ceph_destroy_options(client->options); in ceph_destroy_client()
775 kfree(client); in ceph_destroy_client()
776 dout("destroy_client %p done\n", client); in ceph_destroy_client()
780 void ceph_reset_client_addr(struct ceph_client *client) in ceph_reset_client_addr() argument
782 ceph_messenger_reset_nonce(&client->msgr); in ceph_reset_client_addr()
783 ceph_monc_reopen_session(&client->monc); in ceph_reset_client_addr()
784 ceph_osdc_reopen_osds(&client->osdc); in ceph_reset_client_addr()
791 static bool have_mon_and_osd_map(struct ceph_client *client) in have_mon_and_osd_map() argument
793 return client->monc.monmap && client->monc.monmap->epoch && in have_mon_and_osd_map()
794 client->osdc.osdmap && client->osdc.osdmap->epoch; in have_mon_and_osd_map()
800 int __ceph_open_session(struct ceph_client *client, unsigned long started) in __ceph_open_session() argument
802 unsigned long timeout = client->options->mount_timeout; in __ceph_open_session()
806 err = ceph_monc_open_session(&client->monc); in __ceph_open_session()
810 while (!have_mon_and_osd_map(client)) { in __ceph_open_session()
816 err = wait_event_interruptible_timeout(client->auth_wq, in __ceph_open_session()
817 have_mon_and_osd_map(client) || (client->auth_err < 0), in __ceph_open_session()
821 if (client->auth_err < 0) in __ceph_open_session()
822 return client->auth_err; in __ceph_open_session()
825 pr_info("client%llu fsid %pU\n", ceph_client_gid(client), in __ceph_open_session()
826 &client->fsid); in __ceph_open_session()
827 ceph_debugfs_client_init(client); in __ceph_open_session()
833 int ceph_open_session(struct ceph_client *client) in ceph_open_session() argument
839 mutex_lock(&client->mount_mutex); in ceph_open_session()
841 ret = __ceph_open_session(client, started); in ceph_open_session()
843 mutex_unlock(&client->mount_mutex); in ceph_open_session()
848 int ceph_wait_for_latest_osdmap(struct ceph_client *client, in ceph_wait_for_latest_osdmap() argument
854 ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch); in ceph_wait_for_latest_osdmap()
858 if (client->osdc.osdmap->epoch >= newest_epoch) in ceph_wait_for_latest_osdmap()
861 ceph_osdc_maybe_request_map(&client->osdc); in ceph_wait_for_latest_osdmap()
862 return ceph_monc_wait_osdmap(&client->monc, newest_epoch, timeout); in ceph_wait_for_latest_osdmap()