aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-06-01 15:56:43 -0400
committerAlex Elder <elder@dreamhost.com>2012-06-06 10:23:54 -0400
commit6740a845b2543cc46e1902ba21bac743fbadd0dc (patch)
treec59f9b2eaf77083a1432ee1c24ffbffc081b9c0d /net/ceph/messenger.c
parent92ce034b5a740046cc643a21ea21eaad589e0043 (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/messenger.c')
-rw-r--r--net/ceph/messenger.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 88ac083bb995..d636903ad4b2 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2421,8 +2421,13 @@ EXPORT_SYMBOL(ceph_con_send);
2421/* 2421/*
2422 * Revoke a message that was previously queued for send 2422 * Revoke a message that was previously queued for send
2423 */ 2423 */
2424void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg) 2424void ceph_msg_revoke(struct ceph_msg *msg)
2425{ 2425{
2426 struct ceph_connection *con = msg->con;
2427
2428 if (!con)
2429 return; /* Message not in our possession */
2430
2426 mutex_lock(&con->mutex); 2431 mutex_lock(&con->mutex);
2427 if (!list_empty(&msg->list_head)) { 2432 if (!list_empty(&msg->list_head)) {
2428 dout("%s %p msg %p - was on queue\n", __func__, con, msg); 2433 dout("%s %p msg %p - was on queue\n", __func__, con, msg);