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:55 -0400 |
commit | 8921d114f5574c6da2cdd00749d185633ecf88f3 (patch) | |
tree | fcbb7ffc4061c9ea0260f5b8643abf3096d7267e /net/ceph/osd_client.c | |
parent | 6740a845b2543cc46e1902ba21bac743fbadd0dc (diff) |
libceph: make ceph_con_revoke_message() a msg op
ceph_con_revoke_message() is passed both a message and a ceph
connection. A ceph_msg allocated for incoming messages on a
connection always has a pointer to that connection, so there's no
need to provide the connection when revoking such a message.
Note that the existing logic does not preclude the message supplied
being a null/bogus message pointer. The only user of this interface
is the OSD client, and the only value an osd client passes is a
request's r_reply field. That is always non-null (except briefly in
an error path in ceph_osdc_alloc_request(), and that drops the
only reference so the request won't ever have a reply to revoke).
So we can safely assume the passed-in message is non-null, but add a
BUG_ON() to make it very obvious we are imposing this restriction.
Rename the function ceph_msg_revoke_incoming() to reflect that it is
really an operation on an incoming message.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index ad78705a4aff..c178c770acb4 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -140,10 +140,9 @@ void ceph_osdc_release_request(struct kref *kref) | |||
140 | if (req->r_request) | 140 | if (req->r_request) |
141 | ceph_msg_put(req->r_request); | 141 | ceph_msg_put(req->r_request); |
142 | if (req->r_con_filling_msg) { | 142 | if (req->r_con_filling_msg) { |
143 | dout("release_request revoking pages %p from con %p\n", | 143 | dout("%s revoking pages %p from con %p\n", __func__, |
144 | req->r_pages, req->r_con_filling_msg); | 144 | req->r_pages, req->r_con_filling_msg); |
145 | ceph_con_revoke_message(req->r_con_filling_msg, | 145 | ceph_msg_revoke_incoming(req->r_reply); |
146 | req->r_reply); | ||
147 | req->r_con_filling_msg->ops->put(req->r_con_filling_msg); | 146 | req->r_con_filling_msg->ops->put(req->r_con_filling_msg); |
148 | } | 147 | } |
149 | if (req->r_reply) | 148 | if (req->r_reply) |
@@ -2022,9 +2021,9 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
2022 | } | 2021 | } |
2023 | 2022 | ||
2024 | if (req->r_con_filling_msg) { | 2023 | if (req->r_con_filling_msg) { |
2025 | dout("get_reply revoking msg %p from old con %p\n", | 2024 | dout("%s revoking msg %p from old con %p\n", __func__, |
2026 | req->r_reply, req->r_con_filling_msg); | 2025 | req->r_reply, req->r_con_filling_msg); |
2027 | ceph_con_revoke_message(req->r_con_filling_msg, req->r_reply); | 2026 | ceph_msg_revoke_incoming(req->r_reply); |
2028 | req->r_con_filling_msg->ops->put(req->r_con_filling_msg); | 2027 | req->r_con_filling_msg->ops->put(req->r_con_filling_msg); |
2029 | req->r_con_filling_msg = NULL; | 2028 | req->r_con_filling_msg = NULL; |
2030 | } | 2029 | } |