Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libceph, ceph: disambiguate ceph_connection_operations handlers

Since a few years, kernel addresses are no longer included in oops
dumps, at least on x86. All we get is a symbol name with offset and
size.

This is a problem for ceph_connection_operations handlers, especially
con->ops->dispatch(). All three handlers have the same name and there
is little context to disambiguate between e.g. monitor and OSD clients
because almost everything is inlined. gdb sneakily stops at the first
matching symbol, so one has to resort to nm and addr2line.

Some of these are already prefixed with mon_, osd_ or mds_. Let's do
the same for all others.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Jeff Layton <jlayton@kernel.org>

+44 -44
+17 -17
fs/ceph/mds_client.c
··· 5038 5038 return; 5039 5039 } 5040 5040 5041 - static struct ceph_connection *con_get(struct ceph_connection *con) 5041 + static struct ceph_connection *mds_get_con(struct ceph_connection *con) 5042 5042 { 5043 5043 struct ceph_mds_session *s = con->private; 5044 5044 ··· 5047 5047 return NULL; 5048 5048 } 5049 5049 5050 - static void con_put(struct ceph_connection *con) 5050 + static void mds_put_con(struct ceph_connection *con) 5051 5051 { 5052 5052 struct ceph_mds_session *s = con->private; 5053 5053 ··· 5058 5058 * if the client is unresponsive for long enough, the mds will kill 5059 5059 * the session entirely. 5060 5060 */ 5061 - static void peer_reset(struct ceph_connection *con) 5061 + static void mds_peer_reset(struct ceph_connection *con) 5062 5062 { 5063 5063 struct ceph_mds_session *s = con->private; 5064 5064 struct ceph_mds_client *mdsc = s->s_mdsc; ··· 5067 5067 send_mds_reconnect(mdsc, s); 5068 5068 } 5069 5069 5070 - static void dispatch(struct ceph_connection *con, struct ceph_msg *msg) 5070 + static void mds_dispatch(struct ceph_connection *con, struct ceph_msg *msg) 5071 5071 { 5072 5072 struct ceph_mds_session *s = con->private; 5073 5073 struct ceph_mds_client *mdsc = s->s_mdsc; ··· 5125 5125 * Note: returned pointer is the address of a structure that's 5126 5126 * managed separately. Caller must *not* attempt to free it. 5127 5127 */ 5128 - static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con, 5129 - int *proto, int force_new) 5128 + static struct ceph_auth_handshake * 5129 + mds_get_authorizer(struct ceph_connection *con, int *proto, int force_new) 5130 5130 { 5131 5131 struct ceph_mds_session *s = con->private; 5132 5132 struct ceph_mds_client *mdsc = s->s_mdsc; ··· 5142 5142 return auth; 5143 5143 } 5144 5144 5145 - static int add_authorizer_challenge(struct ceph_connection *con, 5145 + static int mds_add_authorizer_challenge(struct ceph_connection *con, 5146 5146 void *challenge_buf, int challenge_buf_len) 5147 5147 { 5148 5148 struct ceph_mds_session *s = con->private; ··· 5153 5153 challenge_buf, challenge_buf_len); 5154 5154 } 5155 5155 5156 - static int verify_authorizer_reply(struct ceph_connection *con) 5156 + static int mds_verify_authorizer_reply(struct ceph_connection *con) 5157 5157 { 5158 5158 struct ceph_mds_session *s = con->private; 5159 5159 struct ceph_mds_client *mdsc = s->s_mdsc; ··· 5165 5165 NULL, NULL, NULL, NULL); 5166 5166 } 5167 5167 5168 - static int invalidate_authorizer(struct ceph_connection *con) 5168 + static int mds_invalidate_authorizer(struct ceph_connection *con) 5169 5169 { 5170 5170 struct ceph_mds_session *s = con->private; 5171 5171 struct ceph_mds_client *mdsc = s->s_mdsc; ··· 5288 5288 } 5289 5289 5290 5290 static const struct ceph_connection_operations mds_con_ops = { 5291 - .get = con_get, 5292 - .put = con_put, 5293 - .dispatch = dispatch, 5294 - .get_authorizer = get_authorizer, 5295 - .add_authorizer_challenge = add_authorizer_challenge, 5296 - .verify_authorizer_reply = verify_authorizer_reply, 5297 - .invalidate_authorizer = invalidate_authorizer, 5298 - .peer_reset = peer_reset, 5291 + .get = mds_get_con, 5292 + .put = mds_put_con, 5299 5293 .alloc_msg = mds_alloc_msg, 5294 + .dispatch = mds_dispatch, 5295 + .peer_reset = mds_peer_reset, 5296 + .get_authorizer = mds_get_authorizer, 5297 + .add_authorizer_challenge = mds_add_authorizer_challenge, 5298 + .verify_authorizer_reply = mds_verify_authorizer_reply, 5299 + .invalidate_authorizer = mds_invalidate_authorizer, 5300 5300 .sign_message = mds_sign_message, 5301 5301 .check_message_signature = mds_check_message_signature, 5302 5302 .get_auth_request = mds_get_auth_request,
+7 -7
net/ceph/mon_client.c
··· 1433 1433 /* 1434 1434 * handle incoming message 1435 1435 */ 1436 - static void dispatch(struct ceph_connection *con, struct ceph_msg *msg) 1436 + static void mon_dispatch(struct ceph_connection *con, struct ceph_msg *msg) 1437 1437 { 1438 1438 struct ceph_mon_client *monc = con->private; 1439 1439 int type = le16_to_cpu(msg->hdr.type); ··· 1565 1565 * will come from the messenger workqueue, which is drained prior to 1566 1566 * mon_client destruction. 1567 1567 */ 1568 - static struct ceph_connection *con_get(struct ceph_connection *con) 1568 + static struct ceph_connection *mon_get_con(struct ceph_connection *con) 1569 1569 { 1570 1570 return con; 1571 1571 } 1572 1572 1573 - static void con_put(struct ceph_connection *con) 1573 + static void mon_put_con(struct ceph_connection *con) 1574 1574 { 1575 1575 } 1576 1576 1577 1577 static const struct ceph_connection_operations mon_con_ops = { 1578 - .get = con_get, 1579 - .put = con_put, 1580 - .dispatch = dispatch, 1581 - .fault = mon_fault, 1578 + .get = mon_get_con, 1579 + .put = mon_put_con, 1582 1580 .alloc_msg = mon_alloc_msg, 1581 + .dispatch = mon_dispatch, 1582 + .fault = mon_fault, 1583 1583 .get_auth_request = mon_get_auth_request, 1584 1584 .handle_auth_reply_more = mon_handle_auth_reply_more, 1585 1585 .handle_auth_done = mon_handle_auth_done,
+20 -20
net/ceph/osd_client.c
··· 5412 5412 /* 5413 5413 * handle incoming message 5414 5414 */ 5415 - static void dispatch(struct ceph_connection *con, struct ceph_msg *msg) 5415 + static void osd_dispatch(struct ceph_connection *con, struct ceph_msg *msg) 5416 5416 { 5417 5417 struct ceph_osd *osd = con->private; 5418 5418 struct ceph_osd_client *osdc = osd->o_osdc; ··· 5534 5534 return m; 5535 5535 } 5536 5536 5537 - static struct ceph_msg *alloc_msg(struct ceph_connection *con, 5538 - struct ceph_msg_header *hdr, 5539 - int *skip) 5537 + static struct ceph_msg *osd_alloc_msg(struct ceph_connection *con, 5538 + struct ceph_msg_header *hdr, 5539 + int *skip) 5540 5540 { 5541 5541 struct ceph_osd *osd = con->private; 5542 5542 int type = le16_to_cpu(hdr->type); ··· 5560 5560 /* 5561 5561 * Wrappers to refcount containing ceph_osd struct 5562 5562 */ 5563 - static struct ceph_connection *get_osd_con(struct ceph_connection *con) 5563 + static struct ceph_connection *osd_get_con(struct ceph_connection *con) 5564 5564 { 5565 5565 struct ceph_osd *osd = con->private; 5566 5566 if (get_osd(osd)) ··· 5568 5568 return NULL; 5569 5569 } 5570 5570 5571 - static void put_osd_con(struct ceph_connection *con) 5571 + static void osd_put_con(struct ceph_connection *con) 5572 5572 { 5573 5573 struct ceph_osd *osd = con->private; 5574 5574 put_osd(osd); ··· 5582 5582 * Note: returned pointer is the address of a structure that's 5583 5583 * managed separately. Caller must *not* attempt to free it. 5584 5584 */ 5585 - static struct ceph_auth_handshake *get_authorizer(struct ceph_connection *con, 5586 - int *proto, int force_new) 5585 + static struct ceph_auth_handshake * 5586 + osd_get_authorizer(struct ceph_connection *con, int *proto, int force_new) 5587 5587 { 5588 5588 struct ceph_osd *o = con->private; 5589 5589 struct ceph_osd_client *osdc = o->o_osdc; ··· 5599 5599 return auth; 5600 5600 } 5601 5601 5602 - static int add_authorizer_challenge(struct ceph_connection *con, 5602 + static int osd_add_authorizer_challenge(struct ceph_connection *con, 5603 5603 void *challenge_buf, int challenge_buf_len) 5604 5604 { 5605 5605 struct ceph_osd *o = con->private; ··· 5610 5610 challenge_buf, challenge_buf_len); 5611 5611 } 5612 5612 5613 - static int verify_authorizer_reply(struct ceph_connection *con) 5613 + static int osd_verify_authorizer_reply(struct ceph_connection *con) 5614 5614 { 5615 5615 struct ceph_osd *o = con->private; 5616 5616 struct ceph_osd_client *osdc = o->o_osdc; ··· 5622 5622 NULL, NULL, NULL, NULL); 5623 5623 } 5624 5624 5625 - static int invalidate_authorizer(struct ceph_connection *con) 5625 + static int osd_invalidate_authorizer(struct ceph_connection *con) 5626 5626 { 5627 5627 struct ceph_osd *o = con->private; 5628 5628 struct ceph_osd_client *osdc = o->o_osdc; ··· 5731 5731 } 5732 5732 5733 5733 static const struct ceph_connection_operations osd_con_ops = { 5734 - .get = get_osd_con, 5735 - .put = put_osd_con, 5736 - .dispatch = dispatch, 5737 - .get_authorizer = get_authorizer, 5738 - .add_authorizer_challenge = add_authorizer_challenge, 5739 - .verify_authorizer_reply = verify_authorizer_reply, 5740 - .invalidate_authorizer = invalidate_authorizer, 5741 - .alloc_msg = alloc_msg, 5734 + .get = osd_get_con, 5735 + .put = osd_put_con, 5736 + .alloc_msg = osd_alloc_msg, 5737 + .dispatch = osd_dispatch, 5738 + .fault = osd_fault, 5742 5739 .reencode_message = osd_reencode_message, 5740 + .get_authorizer = osd_get_authorizer, 5741 + .add_authorizer_challenge = osd_add_authorizer_challenge, 5742 + .verify_authorizer_reply = osd_verify_authorizer_reply, 5743 + .invalidate_authorizer = osd_invalidate_authorizer, 5743 5744 .sign_message = osd_sign_message, 5744 5745 .check_message_signature = osd_check_message_signature, 5745 - .fault = osd_fault, 5746 5746 .get_auth_request = osd_get_auth_request, 5747 5747 .handle_auth_reply_more = osd_handle_auth_reply_more, 5748 5748 .handle_auth_done = osd_handle_auth_done,