Lines Matching refs:client

98 int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)  in ceph_check_fsid()  argument
100 if (client->have_fsid) { in ceph_check_fsid()
101 if (ceph_fsid_compare(&client->fsid, fsid)) { in ceph_check_fsid()
103 &client->fsid, fsid); in ceph_check_fsid()
107 memcpy(&client->fsid, fsid, sizeof(*fsid)); in ceph_check_fsid()
125 struct ceph_client *client) in ceph_compare_options() argument
128 struct ceph_options *opt2 = client->options; in ceph_compare_options()
137 if (!net_eq(current->nsproxy->net_ns, read_pnet(&client->msgr.net))) in ceph_compare_options()
174 if (ceph_monmap_contains(client->monc.monmap, in ceph_compare_options()
526 int ceph_print_client_options(struct seq_file *m, struct ceph_client *client) in ceph_print_client_options() argument
528 struct ceph_options *opt = client->options; in ceph_print_client_options()
570 u64 ceph_client_id(struct ceph_client *client) in ceph_client_id() argument
572 return client->monc.auth->global_id; in ceph_client_id()
583 struct ceph_client *client; in ceph_create_client() local
587 client = kzalloc(sizeof(*client), GFP_KERNEL); in ceph_create_client()
588 if (client == NULL) in ceph_create_client()
591 client->private = private; in ceph_create_client()
592 client->options = opt; in ceph_create_client()
594 mutex_init(&client->mount_mutex); in ceph_create_client()
595 init_waitqueue_head(&client->auth_wq); in ceph_create_client()
596 client->auth_err = 0; in ceph_create_client()
598 if (!ceph_test_opt(client, NOMSGAUTH)) in ceph_create_client()
601 client->extra_mon_dispatch = NULL; in ceph_create_client()
602 client->supported_features = CEPH_FEATURES_SUPPORTED_DEFAULT | in ceph_create_client()
604 client->required_features = CEPH_FEATURES_REQUIRED_DEFAULT | in ceph_create_client()
608 if (ceph_test_opt(client, MYIP)) in ceph_create_client()
609 myaddr = &client->options->my_addr; in ceph_create_client()
611 ceph_messenger_init(&client->msgr, myaddr); in ceph_create_client()
614 err = ceph_monc_init(&client->monc, client); in ceph_create_client()
617 err = ceph_osdc_init(&client->osdc, client); in ceph_create_client()
621 return client; in ceph_create_client()
624 ceph_monc_stop(&client->monc); in ceph_create_client()
626 ceph_messenger_fini(&client->msgr); in ceph_create_client()
627 kfree(client); in ceph_create_client()
632 void ceph_destroy_client(struct ceph_client *client) in ceph_destroy_client() argument
634 dout("destroy_client %p\n", client); in ceph_destroy_client()
636 atomic_set(&client->msgr.stopping, 1); in ceph_destroy_client()
639 ceph_osdc_stop(&client->osdc); in ceph_destroy_client()
640 ceph_monc_stop(&client->monc); in ceph_destroy_client()
641 ceph_messenger_fini(&client->msgr); in ceph_destroy_client()
643 ceph_debugfs_client_cleanup(client); in ceph_destroy_client()
645 ceph_destroy_options(client->options); in ceph_destroy_client()
647 kfree(client); in ceph_destroy_client()
648 dout("destroy_client %p done\n", client); in ceph_destroy_client()
655 static int have_mon_and_osd_map(struct ceph_client *client) in have_mon_and_osd_map() argument
657 return client->monc.monmap && client->monc.monmap->epoch && in have_mon_and_osd_map()
658 client->osdc.osdmap && client->osdc.osdmap->epoch; in have_mon_and_osd_map()
664 int __ceph_open_session(struct ceph_client *client, unsigned long started) in __ceph_open_session() argument
666 unsigned long timeout = client->options->mount_timeout; in __ceph_open_session()
670 err = ceph_monc_open_session(&client->monc); in __ceph_open_session()
674 while (!have_mon_and_osd_map(client)) { in __ceph_open_session()
680 err = wait_event_interruptible_timeout(client->auth_wq, in __ceph_open_session()
681 have_mon_and_osd_map(client) || (client->auth_err < 0), in __ceph_open_session()
685 if (client->auth_err < 0) in __ceph_open_session()
686 return client->auth_err; in __ceph_open_session()
694 int ceph_open_session(struct ceph_client *client) in ceph_open_session() argument
700 mutex_lock(&client->mount_mutex); in ceph_open_session()
702 ret = __ceph_open_session(client, started); in ceph_open_session()
704 mutex_unlock(&client->mount_mutex); in ceph_open_session()