diff options
author | Alex Elder <elder@inktank.com> | 2012-06-01 15:56:43 -0400 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-06-06 10:23:54 -0400 |
commit | 6740a845b2543cc46e1902ba21bac743fbadd0dc (patch) | |
tree | c59f9b2eaf77083a1432ee1c24ffbffc081b9c0d /net/ceph/mon_client.c | |
parent | 92ce034b5a740046cc643a21ea21eaad589e0043 (diff) |
libceph: make ceph_con_revoke() a msg operation
ceph_con_revoke() is passed both a message and a ceph connection.
Now that any message associated with a connection holds a pointer
to that connection, there's no need to provide the connection when
revoking a message.
This has the added benefit of precluding the possibility of the
providing the wrong connection pointer. If the message's connection
pointer is null, it is not being tracked by any connection, so
revoking it is a no-op. This is supported as a convenience for
upper layers, so they can revoke a message that is not actually
"in flight."
Rename the function ceph_msg_revoke() to reflect that it is really
an operation on a message, not a connection.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/mon_client.c')
-rw-r--r-- | net/ceph/mon_client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index 8462ccec6333..7a16750d62a6 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c | |||
@@ -106,7 +106,7 @@ static void __send_prepared_auth_request(struct ceph_mon_client *monc, int len) | |||
106 | monc->pending_auth = 1; | 106 | monc->pending_auth = 1; |
107 | monc->m_auth->front.iov_len = len; | 107 | monc->m_auth->front.iov_len = len; |
108 | monc->m_auth->hdr.front_len = cpu_to_le32(len); | 108 | monc->m_auth->hdr.front_len = cpu_to_le32(len); |
109 | ceph_con_revoke(&monc->con, monc->m_auth); | 109 | ceph_msg_revoke(monc->m_auth); |
110 | ceph_msg_get(monc->m_auth); /* keep our ref */ | 110 | ceph_msg_get(monc->m_auth); /* keep our ref */ |
111 | ceph_con_send(&monc->con, monc->m_auth); | 111 | ceph_con_send(&monc->con, monc->m_auth); |
112 | } | 112 | } |
@@ -117,7 +117,7 @@ static void __send_prepared_auth_request(struct ceph_mon_client *monc, int len) | |||
117 | static void __close_session(struct ceph_mon_client *monc) | 117 | static void __close_session(struct ceph_mon_client *monc) |
118 | { | 118 | { |
119 | dout("__close_session closing mon%d\n", monc->cur_mon); | 119 | dout("__close_session closing mon%d\n", monc->cur_mon); |
120 | ceph_con_revoke(&monc->con, monc->m_auth); | 120 | ceph_msg_revoke(monc->m_auth); |
121 | ceph_con_close(&monc->con); | 121 | ceph_con_close(&monc->con); |
122 | monc->con.private = NULL; | 122 | monc->con.private = NULL; |
123 | monc->cur_mon = -1; | 123 | monc->cur_mon = -1; |
@@ -229,7 +229,7 @@ static void __send_subscribe(struct ceph_mon_client *monc) | |||
229 | 229 | ||
230 | msg->front.iov_len = p - msg->front.iov_base; | 230 | msg->front.iov_len = p - msg->front.iov_base; |
231 | msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); | 231 | msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); |
232 | ceph_con_revoke(&monc->con, msg); | 232 | ceph_msg_revoke(msg); |
233 | ceph_con_send(&monc->con, ceph_msg_get(msg)); | 233 | ceph_con_send(&monc->con, ceph_msg_get(msg)); |
234 | 234 | ||
235 | monc->sub_sent = jiffies | 1; /* never 0 */ | 235 | monc->sub_sent = jiffies | 1; /* never 0 */ |
@@ -688,7 +688,7 @@ static void __resend_generic_request(struct ceph_mon_client *monc) | |||
688 | 688 | ||
689 | for (p = rb_first(&monc->generic_request_tree); p; p = rb_next(p)) { | 689 | for (p = rb_first(&monc->generic_request_tree); p; p = rb_next(p)) { |
690 | req = rb_entry(p, struct ceph_mon_generic_request, node); | 690 | req = rb_entry(p, struct ceph_mon_generic_request, node); |
691 | ceph_con_revoke(&monc->con, req->request); | 691 | ceph_msg_revoke(req->request); |
692 | ceph_con_send(&monc->con, ceph_msg_get(req->request)); | 692 | ceph_con_send(&monc->con, ceph_msg_get(req->request)); |
693 | } | 693 | } |
694 | } | 694 | } |