Lines Matching refs:client

99 int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)  in ceph_check_fsid()  argument
101 if (client->have_fsid) { in ceph_check_fsid()
102 if (ceph_fsid_compare(&client->fsid, fsid)) { in ceph_check_fsid()
104 &client->fsid, fsid); in ceph_check_fsid()
108 memcpy(&client->fsid, fsid, sizeof(*fsid)); in ceph_check_fsid()
126 struct ceph_client *client) in ceph_compare_options() argument
129 struct ceph_options *opt2 = client->options; in ceph_compare_options()
168 if (ceph_monmap_contains(client->monc.monmap, in ceph_compare_options()
493 int ceph_print_client_options(struct seq_file *m, struct ceph_client *client) in ceph_print_client_options() argument
495 struct ceph_options *opt = client->options; in ceph_print_client_options()
533 u64 ceph_client_id(struct ceph_client *client) in ceph_client_id() argument
535 return client->monc.auth->global_id; in ceph_client_id()
546 struct ceph_client *client; in ceph_create_client() local
550 client = kzalloc(sizeof(*client), GFP_KERNEL); in ceph_create_client()
551 if (client == NULL) in ceph_create_client()
554 client->private = private; in ceph_create_client()
555 client->options = opt; in ceph_create_client()
557 mutex_init(&client->mount_mutex); in ceph_create_client()
558 init_waitqueue_head(&client->auth_wq); in ceph_create_client()
559 client->auth_err = 0; in ceph_create_client()
561 if (!ceph_test_opt(client, NOMSGAUTH)) in ceph_create_client()
564 client->extra_mon_dispatch = NULL; in ceph_create_client()
565 client->supported_features = CEPH_FEATURES_SUPPORTED_DEFAULT | in ceph_create_client()
567 client->required_features = CEPH_FEATURES_REQUIRED_DEFAULT | in ceph_create_client()
571 if (ceph_test_opt(client, MYIP)) in ceph_create_client()
572 myaddr = &client->options->my_addr; in ceph_create_client()
574 ceph_messenger_init(&client->msgr, myaddr, in ceph_create_client()
575 client->supported_features, in ceph_create_client()
576 client->required_features, in ceph_create_client()
577 ceph_test_opt(client, NOCRC), in ceph_create_client()
578 ceph_test_opt(client, TCP_NODELAY)); in ceph_create_client()
581 err = ceph_monc_init(&client->monc, client); in ceph_create_client()
584 err = ceph_osdc_init(&client->osdc, client); in ceph_create_client()
588 return client; in ceph_create_client()
591 ceph_monc_stop(&client->monc); in ceph_create_client()
593 kfree(client); in ceph_create_client()
598 void ceph_destroy_client(struct ceph_client *client) in ceph_destroy_client() argument
600 dout("destroy_client %p\n", client); in ceph_destroy_client()
602 atomic_set(&client->msgr.stopping, 1); in ceph_destroy_client()
605 ceph_osdc_stop(&client->osdc); in ceph_destroy_client()
607 ceph_monc_stop(&client->monc); in ceph_destroy_client()
609 ceph_debugfs_client_cleanup(client); in ceph_destroy_client()
611 ceph_destroy_options(client->options); in ceph_destroy_client()
613 kfree(client); in ceph_destroy_client()
614 dout("destroy_client %p done\n", client); in ceph_destroy_client()
621 static int have_mon_and_osd_map(struct ceph_client *client) in have_mon_and_osd_map() argument
623 return client->monc.monmap && client->monc.monmap->epoch && in have_mon_and_osd_map()
624 client->osdc.osdmap && client->osdc.osdmap->epoch; in have_mon_and_osd_map()
630 int __ceph_open_session(struct ceph_client *client, unsigned long started) in __ceph_open_session() argument
633 unsigned long timeout = client->options->mount_timeout * HZ; in __ceph_open_session()
636 err = ceph_monc_open_session(&client->monc); in __ceph_open_session()
640 while (!have_mon_and_osd_map(client)) { in __ceph_open_session()
647 err = wait_event_interruptible_timeout(client->auth_wq, in __ceph_open_session()
648 have_mon_and_osd_map(client) || (client->auth_err < 0), in __ceph_open_session()
652 if (client->auth_err < 0) in __ceph_open_session()
653 return client->auth_err; in __ceph_open_session()
661 int ceph_open_session(struct ceph_client *client) in ceph_open_session() argument
667 mutex_lock(&client->mount_mutex); in ceph_open_session()
669 ret = __ceph_open_session(client, started); in ceph_open_session()
671 mutex_unlock(&client->mount_mutex); in ceph_open_session()