Lines Matching refs:monc
37 static int __validate_auth(struct ceph_mon_client *monc);
108 static void __send_prepared_auth_request(struct ceph_mon_client *monc, int len) in __send_prepared_auth_request() argument
110 monc->pending_auth = 1; in __send_prepared_auth_request()
111 monc->m_auth->front.iov_len = len; in __send_prepared_auth_request()
112 monc->m_auth->hdr.front_len = cpu_to_le32(len); in __send_prepared_auth_request()
113 ceph_msg_revoke(monc->m_auth); in __send_prepared_auth_request()
114 ceph_msg_get(monc->m_auth); /* keep our ref */ in __send_prepared_auth_request()
115 ceph_con_send(&monc->con, monc->m_auth); in __send_prepared_auth_request()
121 static void __close_session(struct ceph_mon_client *monc) in __close_session() argument
123 dout("__close_session closing mon%d\n", monc->cur_mon); in __close_session()
124 ceph_msg_revoke(monc->m_auth); in __close_session()
125 ceph_msg_revoke_incoming(monc->m_auth_reply); in __close_session()
126 ceph_msg_revoke(monc->m_subscribe); in __close_session()
127 ceph_msg_revoke_incoming(monc->m_subscribe_ack); in __close_session()
128 ceph_con_close(&monc->con); in __close_session()
130 monc->pending_auth = 0; in __close_session()
131 ceph_auth_reset(monc->auth); in __close_session()
138 static void pick_new_mon(struct ceph_mon_client *monc) in pick_new_mon() argument
140 int old_mon = monc->cur_mon; in pick_new_mon()
142 BUG_ON(monc->monmap->num_mon < 1); in pick_new_mon()
144 if (monc->monmap->num_mon == 1) { in pick_new_mon()
145 monc->cur_mon = 0; in pick_new_mon()
147 int max = monc->monmap->num_mon; in pick_new_mon()
151 if (monc->cur_mon >= 0) { in pick_new_mon()
152 if (monc->cur_mon < monc->monmap->num_mon) in pick_new_mon()
153 o = monc->cur_mon; in pick_new_mon()
162 monc->cur_mon = n; in pick_new_mon()
166 monc->cur_mon, monc->monmap->num_mon); in pick_new_mon()
172 static void __open_session(struct ceph_mon_client *monc) in __open_session() argument
176 pick_new_mon(monc); in __open_session()
178 monc->hunting = true; in __open_session()
179 if (monc->had_a_connection) { in __open_session()
180 monc->hunt_mult *= CEPH_MONC_HUNT_BACKOFF; in __open_session()
181 if (monc->hunt_mult > CEPH_MONC_HUNT_MAX_MULT) in __open_session()
182 monc->hunt_mult = CEPH_MONC_HUNT_MAX_MULT; in __open_session()
185 monc->sub_renew_after = jiffies; /* i.e., expired */ in __open_session()
186 monc->sub_renew_sent = 0; in __open_session()
188 dout("%s opening mon%d\n", __func__, monc->cur_mon); in __open_session()
189 ceph_con_open(&monc->con, CEPH_ENTITY_TYPE_MON, monc->cur_mon, in __open_session()
190 &monc->monmap->mon_inst[monc->cur_mon].addr); in __open_session()
196 ceph_con_keepalive(&monc->con); in __open_session()
199 ret = ceph_auth_build_hello(monc->auth, in __open_session()
200 monc->m_auth->front.iov_base, in __open_session()
201 monc->m_auth->front_alloc_len); in __open_session()
203 __send_prepared_auth_request(monc, ret); in __open_session()
206 static void reopen_session(struct ceph_mon_client *monc) in reopen_session() argument
208 if (!monc->hunting) in reopen_session()
210 monc->cur_mon, ceph_pr_addr(&monc->con.peer_addr)); in reopen_session()
212 __close_session(monc); in reopen_session()
213 __open_session(monc); in reopen_session()
216 void ceph_monc_reopen_session(struct ceph_mon_client *monc) in ceph_monc_reopen_session() argument
218 mutex_lock(&monc->mutex); in ceph_monc_reopen_session()
219 reopen_session(monc); in ceph_monc_reopen_session()
220 mutex_unlock(&monc->mutex); in ceph_monc_reopen_session()
223 static void un_backoff(struct ceph_mon_client *monc) in un_backoff() argument
225 monc->hunt_mult /= 2; /* reduce by 50% */ in un_backoff()
226 if (monc->hunt_mult < 1) in un_backoff()
227 monc->hunt_mult = 1; in un_backoff()
228 dout("%s hunt_mult now %d\n", __func__, monc->hunt_mult); in un_backoff()
234 static void __schedule_delayed(struct ceph_mon_client *monc) in __schedule_delayed() argument
238 if (monc->hunting) in __schedule_delayed()
239 delay = CEPH_MONC_HUNT_INTERVAL * monc->hunt_mult; in __schedule_delayed()
244 mod_delayed_work(system_wq, &monc->delayed_work, in __schedule_delayed()
259 static void __send_subscribe(struct ceph_mon_client *monc) in __send_subscribe() argument
261 struct ceph_msg *msg = monc->m_subscribe; in __send_subscribe()
267 dout("%s sent %lu\n", __func__, monc->sub_renew_sent); in __send_subscribe()
269 BUG_ON(monc->cur_mon < 0); in __send_subscribe()
271 if (!monc->sub_renew_sent) in __send_subscribe()
272 monc->sub_renew_sent = jiffies | 1; /* never 0 */ in __send_subscribe()
276 for (i = 0; i < ARRAY_SIZE(monc->subs); i++) { in __send_subscribe()
277 if (monc->subs[i].want) in __send_subscribe()
282 for (i = 0; i < ARRAY_SIZE(monc->subs); i++) { in __send_subscribe()
286 if (!monc->subs[i].want) in __send_subscribe()
291 monc->fs_cluster_id != CEPH_FS_CLUSTER_ID_NONE) in __send_subscribe()
292 len += sprintf(buf + len, ".%d", monc->fs_cluster_id); in __send_subscribe()
295 le64_to_cpu(monc->subs[i].item.start), in __send_subscribe()
296 monc->subs[i].item.flags); in __send_subscribe()
298 memcpy(p, &monc->subs[i].item, sizeof(monc->subs[i].item)); in __send_subscribe()
299 p += sizeof(monc->subs[i].item); in __send_subscribe()
306 ceph_con_send(&monc->con, ceph_msg_get(msg)); in __send_subscribe()
309 static void handle_subscribe_ack(struct ceph_mon_client *monc, in handle_subscribe_ack() argument
319 mutex_lock(&monc->mutex); in handle_subscribe_ack()
320 if (monc->sub_renew_sent) { in handle_subscribe_ack()
325 monc->sub_renew_after = monc->sub_renew_sent + in handle_subscribe_ack()
328 monc->sub_renew_sent, seconds, monc->sub_renew_after); in handle_subscribe_ack()
329 monc->sub_renew_sent = 0; in handle_subscribe_ack()
332 monc->sub_renew_sent, monc->sub_renew_after); in handle_subscribe_ack()
334 mutex_unlock(&monc->mutex); in handle_subscribe_ack()
347 static bool __ceph_monc_want_map(struct ceph_mon_client *monc, int sub, in __ceph_monc_want_map() argument
356 if (monc->subs[sub].want && in __ceph_monc_want_map()
357 monc->subs[sub].item.start == start && in __ceph_monc_want_map()
358 monc->subs[sub].item.flags == flags) in __ceph_monc_want_map()
361 monc->subs[sub].item.start = start; in __ceph_monc_want_map()
362 monc->subs[sub].item.flags = flags; in __ceph_monc_want_map()
363 monc->subs[sub].want = true; in __ceph_monc_want_map()
368 bool ceph_monc_want_map(struct ceph_mon_client *monc, int sub, u32 epoch, in ceph_monc_want_map() argument
373 mutex_lock(&monc->mutex); in ceph_monc_want_map()
374 need_request = __ceph_monc_want_map(monc, sub, epoch, continuous); in ceph_monc_want_map()
375 mutex_unlock(&monc->mutex); in ceph_monc_want_map()
386 static void __ceph_monc_got_map(struct ceph_mon_client *monc, int sub, in __ceph_monc_got_map() argument
391 if (monc->subs[sub].want) { in __ceph_monc_got_map()
392 if (monc->subs[sub].item.flags & CEPH_SUBSCRIBE_ONETIME) in __ceph_monc_got_map()
393 monc->subs[sub].want = false; in __ceph_monc_got_map()
395 monc->subs[sub].item.start = cpu_to_le64(epoch + 1); in __ceph_monc_got_map()
398 monc->subs[sub].have = epoch; in __ceph_monc_got_map()
401 void ceph_monc_got_map(struct ceph_mon_client *monc, int sub, u32 epoch) in ceph_monc_got_map() argument
403 mutex_lock(&monc->mutex); in ceph_monc_got_map()
404 __ceph_monc_got_map(monc, sub, epoch); in ceph_monc_got_map()
405 mutex_unlock(&monc->mutex); in ceph_monc_got_map()
409 void ceph_monc_renew_subs(struct ceph_mon_client *monc) in ceph_monc_renew_subs() argument
411 mutex_lock(&monc->mutex); in ceph_monc_renew_subs()
412 __send_subscribe(monc); in ceph_monc_renew_subs()
413 mutex_unlock(&monc->mutex); in ceph_monc_renew_subs()
423 int ceph_monc_wait_osdmap(struct ceph_mon_client *monc, u32 epoch, in ceph_monc_wait_osdmap() argument
429 mutex_lock(&monc->mutex); in ceph_monc_wait_osdmap()
430 while (monc->subs[CEPH_SUB_OSDMAP].have < epoch) { in ceph_monc_wait_osdmap()
431 mutex_unlock(&monc->mutex); in ceph_monc_wait_osdmap()
436 ret = wait_event_interruptible_timeout(monc->client->auth_wq, in ceph_monc_wait_osdmap()
437 monc->subs[CEPH_SUB_OSDMAP].have >= epoch, in ceph_monc_wait_osdmap()
442 mutex_lock(&monc->mutex); in ceph_monc_wait_osdmap()
445 mutex_unlock(&monc->mutex); in ceph_monc_wait_osdmap()
454 int ceph_monc_open_session(struct ceph_mon_client *monc) in ceph_monc_open_session() argument
456 mutex_lock(&monc->mutex); in ceph_monc_open_session()
457 __ceph_monc_want_map(monc, CEPH_SUB_MONMAP, 0, true); in ceph_monc_open_session()
458 __ceph_monc_want_map(monc, CEPH_SUB_OSDMAP, 0, false); in ceph_monc_open_session()
459 __open_session(monc); in ceph_monc_open_session()
460 __schedule_delayed(monc); in ceph_monc_open_session()
461 mutex_unlock(&monc->mutex); in ceph_monc_open_session()
466 static void ceph_monc_handle_map(struct ceph_mon_client *monc, in ceph_monc_handle_map() argument
469 struct ceph_client *client = monc->client; in ceph_monc_handle_map()
473 mutex_lock(&monc->mutex); in ceph_monc_handle_map()
492 kfree(monc->monmap); in ceph_monc_handle_map()
493 monc->monmap = monmap; in ceph_monc_handle_map()
495 __ceph_monc_got_map(monc, CEPH_SUB_MONMAP, monc->monmap->epoch); in ceph_monc_handle_map()
499 mutex_unlock(&monc->mutex); in ceph_monc_handle_map()
537 alloc_generic_request(struct ceph_mon_client *monc, gfp_t gfp) in alloc_generic_request() argument
545 req->monc = monc; in alloc_generic_request()
556 struct ceph_mon_client *monc = req->monc; in register_generic_request() local
561 req->tid = ++monc->last_tid; in register_generic_request()
562 insert_generic_request(&monc->generic_request_tree, req); in register_generic_request()
565 static void send_generic_request(struct ceph_mon_client *monc, in send_generic_request() argument
572 ceph_con_send(&monc->con, ceph_msg_get(req->request)); in send_generic_request()
577 struct ceph_mon_client *monc = req->monc; in __finish_generic_request() local
580 erase_generic_request(&monc->generic_request_tree, req); in __finish_generic_request()
603 struct ceph_mon_client *monc = req->monc; in cancel_generic_request() local
608 mutex_lock(&monc->mutex); in cancel_generic_request()
609 lookup_req = lookup_generic_request(&monc->generic_request_tree, in cancel_generic_request()
616 mutex_unlock(&monc->mutex); in cancel_generic_request()
637 struct ceph_mon_client *monc = con->private; in get_generic_reply() local
642 mutex_lock(&monc->mutex); in get_generic_reply()
643 req = lookup_generic_request(&monc->generic_request_tree, tid); in get_generic_reply()
658 mutex_unlock(&monc->mutex); in get_generic_reply()
665 static void handle_statfs_reply(struct ceph_mon_client *monc, in handle_statfs_reply() argument
677 mutex_lock(&monc->mutex); in handle_statfs_reply()
678 req = lookup_generic_request(&monc->generic_request_tree, tid); in handle_statfs_reply()
680 mutex_unlock(&monc->mutex); in handle_statfs_reply()
687 mutex_unlock(&monc->mutex); in handle_statfs_reply()
700 int ceph_monc_do_statfs(struct ceph_mon_client *monc, u64 data_pool, in ceph_monc_do_statfs() argument
707 req = alloc_generic_request(monc, GFP_NOFS); in ceph_monc_do_statfs()
723 mutex_lock(&monc->mutex); in ceph_monc_do_statfs()
730 h->fsid = monc->monmap->fsid; in ceph_monc_do_statfs()
733 send_generic_request(monc, req); in ceph_monc_do_statfs()
734 mutex_unlock(&monc->mutex); in ceph_monc_do_statfs()
743 static void handle_get_version_reply(struct ceph_mon_client *monc, in handle_get_version_reply() argument
759 mutex_lock(&monc->mutex); in handle_get_version_reply()
760 req = lookup_generic_request(&monc->generic_request_tree, handle); in handle_get_version_reply()
762 mutex_unlock(&monc->mutex); in handle_get_version_reply()
769 mutex_unlock(&monc->mutex); in handle_get_version_reply()
780 __ceph_monc_get_version(struct ceph_mon_client *monc, const char *what, in __ceph_monc_get_version() argument
785 req = alloc_generic_request(monc, GFP_NOIO); in __ceph_monc_get_version()
803 mutex_lock(&monc->mutex); in __ceph_monc_get_version()
813 send_generic_request(monc, req); in __ceph_monc_get_version()
814 mutex_unlock(&monc->mutex); in __ceph_monc_get_version()
828 int ceph_monc_get_version(struct ceph_mon_client *monc, const char *what, in ceph_monc_get_version() argument
834 req = __ceph_monc_get_version(monc, what, NULL, 0); in ceph_monc_get_version()
852 int ceph_monc_get_version_async(struct ceph_mon_client *monc, const char *what, in ceph_monc_get_version_async() argument
857 req = __ceph_monc_get_version(monc, what, cb, private_data); in ceph_monc_get_version_async()
866 static void handle_command_ack(struct ceph_mon_client *monc, in handle_command_ack() argument
880 mutex_lock(&monc->mutex); in handle_command_ack()
881 req = lookup_generic_request(&monc->generic_request_tree, tid); in handle_command_ack()
883 mutex_unlock(&monc->mutex); in handle_command_ack()
889 mutex_unlock(&monc->mutex); in handle_command_ack()
900 int do_mon_command_vargs(struct ceph_mon_client *monc, const char *fmt, in do_mon_command_vargs() argument
908 req = alloc_generic_request(monc, GFP_NOIO); in do_mon_command_vargs()
921 mutex_lock(&monc->mutex); in do_mon_command_vargs()
927 h->fsid = monc->monmap->fsid; in do_mon_command_vargs()
931 send_generic_request(monc, req); in do_mon_command_vargs()
932 mutex_unlock(&monc->mutex); in do_mon_command_vargs()
941 int do_mon_command(struct ceph_mon_client *monc, const char *fmt, ...) in do_mon_command() argument
947 ret = do_mon_command_vargs(monc, fmt, ap); in do_mon_command()
952 int ceph_monc_blocklist_add(struct ceph_mon_client *monc, in ceph_monc_blocklist_add() argument
957 ret = do_mon_command(monc, in ceph_monc_blocklist_add()
969 ret = do_mon_command(monc, in ceph_monc_blocklist_add()
985 return ceph_wait_for_latest_osdmap(monc->client, 0); in ceph_monc_blocklist_add()
992 static void __resend_generic_request(struct ceph_mon_client *monc) in __resend_generic_request() argument
997 for (p = rb_first(&monc->generic_request_tree); p; p = rb_next(p)) { in __resend_generic_request()
1001 ceph_con_send(&monc->con, ceph_msg_get(req->request)); in __resend_generic_request()
1012 struct ceph_mon_client *monc = in delayed_work() local
1016 mutex_lock(&monc->mutex); in delayed_work()
1017 if (monc->hunting) { in delayed_work()
1019 reopen_session(monc); in delayed_work()
1021 int is_auth = ceph_auth_is_authenticated(monc->auth); in delayed_work()
1022 if (ceph_con_keepalive_expired(&monc->con, in delayed_work()
1026 reopen_session(monc); in delayed_work()
1029 if (!monc->hunting) { in delayed_work()
1030 ceph_con_keepalive(&monc->con); in delayed_work()
1031 __validate_auth(monc); in delayed_work()
1032 un_backoff(monc); in delayed_work()
1036 !(monc->con.peer_features & CEPH_FEATURE_MON_STATEFUL_SUB)) { in delayed_work()
1040 __func__, now, monc->sub_renew_after); in delayed_work()
1041 if (time_after_eq(now, monc->sub_renew_after)) in delayed_work()
1042 __send_subscribe(monc); in delayed_work()
1045 __schedule_delayed(monc); in delayed_work()
1046 mutex_unlock(&monc->mutex); in delayed_work()
1053 static int build_initial_monmap(struct ceph_mon_client *monc) in build_initial_monmap() argument
1055 struct ceph_options *opt = monc->client->options; in build_initial_monmap()
1061 monc->monmap = kzalloc(struct_size(monc->monmap, mon_inst, num_mon), in build_initial_monmap()
1063 if (!monc->monmap) in build_initial_monmap()
1066 monc->monmap->mon_inst[i].addr = mon_addr[i]; in build_initial_monmap()
1067 monc->monmap->mon_inst[i].addr.nonce = 0; in build_initial_monmap()
1068 monc->monmap->mon_inst[i].name.type = in build_initial_monmap()
1070 monc->monmap->mon_inst[i].name.num = cpu_to_le64(i); in build_initial_monmap()
1072 monc->monmap->num_mon = num_mon; in build_initial_monmap()
1076 int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl) in ceph_monc_init() argument
1081 memset(monc, 0, sizeof(*monc)); in ceph_monc_init()
1082 monc->client = cl; in ceph_monc_init()
1083 monc->monmap = NULL; in ceph_monc_init()
1084 mutex_init(&monc->mutex); in ceph_monc_init()
1086 err = build_initial_monmap(monc); in ceph_monc_init()
1092 monc->auth = ceph_auth_init(cl->options->name, in ceph_monc_init()
1094 if (IS_ERR(monc->auth)) { in ceph_monc_init()
1095 err = PTR_ERR(monc->auth); in ceph_monc_init()
1098 monc->auth->want_keys = in ceph_monc_init()
1104 monc->m_subscribe_ack = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE_ACK, in ceph_monc_init()
1107 if (!monc->m_subscribe_ack) in ceph_monc_init()
1110 monc->m_subscribe = ceph_msg_new(CEPH_MSG_MON_SUBSCRIBE, 128, in ceph_monc_init()
1112 if (!monc->m_subscribe) in ceph_monc_init()
1115 monc->m_auth_reply = ceph_msg_new(CEPH_MSG_AUTH_REPLY, 4096, in ceph_monc_init()
1117 if (!monc->m_auth_reply) in ceph_monc_init()
1120 monc->m_auth = ceph_msg_new(CEPH_MSG_AUTH, 4096, GFP_KERNEL, true); in ceph_monc_init()
1121 monc->pending_auth = 0; in ceph_monc_init()
1122 if (!monc->m_auth) in ceph_monc_init()
1125 ceph_con_init(&monc->con, monc, &mon_con_ops, in ceph_monc_init()
1126 &monc->client->msgr); in ceph_monc_init()
1128 monc->cur_mon = -1; in ceph_monc_init()
1129 monc->had_a_connection = false; in ceph_monc_init()
1130 monc->hunt_mult = 1; in ceph_monc_init()
1132 INIT_DELAYED_WORK(&monc->delayed_work, delayed_work); in ceph_monc_init()
1133 monc->generic_request_tree = RB_ROOT; in ceph_monc_init()
1134 monc->last_tid = 0; in ceph_monc_init()
1136 monc->fs_cluster_id = CEPH_FS_CLUSTER_ID_NONE; in ceph_monc_init()
1141 ceph_msg_put(monc->m_auth_reply); in ceph_monc_init()
1143 ceph_msg_put(monc->m_subscribe); in ceph_monc_init()
1145 ceph_msg_put(monc->m_subscribe_ack); in ceph_monc_init()
1147 ceph_auth_destroy(monc->auth); in ceph_monc_init()
1149 kfree(monc->monmap); in ceph_monc_init()
1155 void ceph_monc_stop(struct ceph_mon_client *monc) in ceph_monc_stop() argument
1158 cancel_delayed_work_sync(&monc->delayed_work); in ceph_monc_stop()
1160 mutex_lock(&monc->mutex); in ceph_monc_stop()
1161 __close_session(monc); in ceph_monc_stop()
1162 monc->cur_mon = -1; in ceph_monc_stop()
1163 mutex_unlock(&monc->mutex); in ceph_monc_stop()
1173 ceph_auth_destroy(monc->auth); in ceph_monc_stop()
1175 WARN_ON(!RB_EMPTY_ROOT(&monc->generic_request_tree)); in ceph_monc_stop()
1177 ceph_msg_put(monc->m_auth); in ceph_monc_stop()
1178 ceph_msg_put(monc->m_auth_reply); in ceph_monc_stop()
1179 ceph_msg_put(monc->m_subscribe); in ceph_monc_stop()
1180 ceph_msg_put(monc->m_subscribe_ack); in ceph_monc_stop()
1182 kfree(monc->monmap); in ceph_monc_stop()
1186 static void finish_hunting(struct ceph_mon_client *monc) in finish_hunting() argument
1188 if (monc->hunting) { in finish_hunting()
1189 dout("%s found mon%d\n", __func__, monc->cur_mon); in finish_hunting()
1190 monc->hunting = false; in finish_hunting()
1191 monc->had_a_connection = true; in finish_hunting()
1192 un_backoff(monc); in finish_hunting()
1193 __schedule_delayed(monc); in finish_hunting()
1197 static void handle_auth_reply(struct ceph_mon_client *monc, in handle_auth_reply() argument
1203 mutex_lock(&monc->mutex); in handle_auth_reply()
1204 was_auth = ceph_auth_is_authenticated(monc->auth); in handle_auth_reply()
1205 monc->pending_auth = 0; in handle_auth_reply()
1206 ret = ceph_handle_auth_reply(monc->auth, msg->front.iov_base, in handle_auth_reply()
1208 monc->m_auth->front.iov_base, in handle_auth_reply()
1209 monc->m_auth->front_alloc_len); in handle_auth_reply()
1211 __send_prepared_auth_request(monc, ret); in handle_auth_reply()
1215 finish_hunting(monc); in handle_auth_reply()
1218 monc->client->auth_err = ret; in handle_auth_reply()
1219 } else if (!was_auth && ceph_auth_is_authenticated(monc->auth)) { in handle_auth_reply()
1222 monc->client->msgr.inst.name.type = CEPH_ENTITY_TYPE_CLIENT; in handle_auth_reply()
1223 monc->client->msgr.inst.name.num = in handle_auth_reply()
1224 cpu_to_le64(monc->auth->global_id); in handle_auth_reply()
1226 __send_subscribe(monc); in handle_auth_reply()
1227 __resend_generic_request(monc); in handle_auth_reply()
1229 pr_info("mon%d %s session established\n", monc->cur_mon, in handle_auth_reply()
1230 ceph_pr_addr(&monc->con.peer_addr)); in handle_auth_reply()
1234 mutex_unlock(&monc->mutex); in handle_auth_reply()
1235 if (monc->client->auth_err < 0) in handle_auth_reply()
1236 wake_up_all(&monc->client->auth_wq); in handle_auth_reply()
1239 static int __validate_auth(struct ceph_mon_client *monc) in __validate_auth() argument
1243 if (monc->pending_auth) in __validate_auth()
1246 ret = ceph_build_auth(monc->auth, monc->m_auth->front.iov_base, in __validate_auth()
1247 monc->m_auth->front_alloc_len); in __validate_auth()
1250 __send_prepared_auth_request(monc, ret); in __validate_auth()
1254 int ceph_monc_validate_auth(struct ceph_mon_client *monc) in ceph_monc_validate_auth() argument
1258 mutex_lock(&monc->mutex); in ceph_monc_validate_auth()
1259 ret = __validate_auth(monc); in ceph_monc_validate_auth()
1260 mutex_unlock(&monc->mutex); in ceph_monc_validate_auth()
1270 struct ceph_mon_client *monc = con->private; in dispatch() local
1275 handle_auth_reply(monc, msg); in dispatch()
1279 handle_subscribe_ack(monc, msg); in dispatch()
1283 handle_statfs_reply(monc, msg); in dispatch()
1287 handle_get_version_reply(monc, msg); in dispatch()
1291 handle_command_ack(monc, msg); in dispatch()
1295 ceph_monc_handle_map(monc, msg); in dispatch()
1299 ceph_osdc_handle_map(&monc->client->osdc, msg); in dispatch()
1304 if (monc->client->extra_mon_dispatch && in dispatch()
1305 monc->client->extra_mon_dispatch(monc->client, msg) == 0) in dispatch()
1321 struct ceph_mon_client *monc = con->private; in mon_alloc_msg() local
1330 m = ceph_msg_get(monc->m_subscribe_ack); in mon_alloc_msg()
1336 m = ceph_msg_get(monc->m_auth_reply); in mon_alloc_msg()
1379 struct ceph_mon_client *monc = con->private; in mon_fault() local
1381 mutex_lock(&monc->mutex); in mon_fault()
1382 dout("%s mon%d\n", __func__, monc->cur_mon); in mon_fault()
1383 if (monc->cur_mon >= 0) { in mon_fault()
1384 if (!monc->hunting) { in mon_fault()
1386 reopen_session(monc); in mon_fault()
1387 __schedule_delayed(monc); in mon_fault()
1392 mutex_unlock(&monc->mutex); in mon_fault()