aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-06-21 15:47:08 -0400
committerAlex Elder <elder@inktank.com>2012-06-22 08:30:27 -0400
commit36eb71aa57e6a33d61fd90a2fd87f00c6844bc86 (patch)
tree0d510e7decf8b2cec0cad6f9888959dffa366398 /net
parent26ce171915f348abd1f41da1ed139d93750d987f (diff)
libceph: use con get/put methods
The ceph_con_get/put() helpers manipulate the embedded con ref count, which isn't used now that ceph_connections are embedded in other structures. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/messenger.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 23073cff648..fc0cee7c9aa 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -414,7 +414,7 @@ static void ceph_msg_remove(struct ceph_msg *msg)
414{ 414{
415 list_del_init(&msg->list_head); 415 list_del_init(&msg->list_head);
416 BUG_ON(msg->con == NULL); 416 BUG_ON(msg->con == NULL);
417 ceph_con_put(msg->con); 417 msg->con->ops->put(msg->con);
418 msg->con = NULL; 418 msg->con = NULL;
419 419
420 ceph_msg_put(msg); 420 ceph_msg_put(msg);
@@ -440,7 +440,7 @@ static void reset_connection(struct ceph_connection *con)
440 con->in_msg->con = NULL; 440 con->in_msg->con = NULL;
441 ceph_msg_put(con->in_msg); 441 ceph_msg_put(con->in_msg);
442 con->in_msg = NULL; 442 con->in_msg = NULL;
443 ceph_con_put(con); 443 con->ops->put(con);
444 } 444 }
445 445
446 con->connect_seq = 0; 446 con->connect_seq = 0;
@@ -1919,7 +1919,7 @@ static void process_message(struct ceph_connection *con)
1919 con->in_msg->con = NULL; 1919 con->in_msg->con = NULL;
1920 msg = con->in_msg; 1920 msg = con->in_msg;
1921 con->in_msg = NULL; 1921 con->in_msg = NULL;
1922 ceph_con_put(con); 1922 con->ops->put(con);
1923 1923
1924 /* if first message, set peer_name */ 1924 /* if first message, set peer_name */
1925 if (con->peer_name.type == 0) 1925 if (con->peer_name.type == 0)
@@ -2281,7 +2281,7 @@ static void ceph_fault(struct ceph_connection *con)
2281 con->in_msg->con = NULL; 2281 con->in_msg->con = NULL;
2282 ceph_msg_put(con->in_msg); 2282 ceph_msg_put(con->in_msg);
2283 con->in_msg = NULL; 2283 con->in_msg = NULL;
2284 ceph_con_put(con); 2284 con->ops->put(con);
2285 } 2285 }
2286 2286
2287 /* Requeue anything that hasn't been acked */ 2287 /* Requeue anything that hasn't been acked */
@@ -2400,7 +2400,7 @@ void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg)
2400 mutex_lock(&con->mutex); 2400 mutex_lock(&con->mutex);
2401 2401
2402 BUG_ON(msg->con != NULL); 2402 BUG_ON(msg->con != NULL);
2403 msg->con = ceph_con_get(con); 2403 msg->con = con->ops->get(con);
2404 BUG_ON(msg->con == NULL); 2404 BUG_ON(msg->con == NULL);
2405 2405
2406 BUG_ON(!list_empty(&msg->list_head)); 2406 BUG_ON(!list_empty(&msg->list_head));
@@ -2436,7 +2436,7 @@ void ceph_msg_revoke(struct ceph_msg *msg)
2436 dout("%s %p msg %p - was on queue\n", __func__, con, msg); 2436 dout("%s %p msg %p - was on queue\n", __func__, con, msg);
2437 list_del_init(&msg->list_head); 2437 list_del_init(&msg->list_head);
2438 BUG_ON(msg->con == NULL); 2438 BUG_ON(msg->con == NULL);
2439 ceph_con_put(msg->con); 2439 msg->con->ops->put(msg->con);
2440 msg->con = NULL; 2440 msg->con = NULL;
2441 msg->hdr.seq = 0; 2441 msg->hdr.seq = 0;
2442 2442
@@ -2646,7 +2646,7 @@ static bool ceph_con_in_msg_alloc(struct ceph_connection *con,
2646 con->in_msg = con->ops->alloc_msg(con, hdr, &skip); 2646 con->in_msg = con->ops->alloc_msg(con, hdr, &skip);
2647 mutex_lock(&con->mutex); 2647 mutex_lock(&con->mutex);
2648 if (con->in_msg) { 2648 if (con->in_msg) {
2649 con->in_msg->con = ceph_con_get(con); 2649 con->in_msg->con = con->ops->get(con);
2650 BUG_ON(con->in_msg->con == NULL); 2650 BUG_ON(con->in_msg->con == NULL);
2651 } 2651 }
2652 if (skip) 2652 if (skip)
@@ -2662,7 +2662,7 @@ static bool ceph_con_in_msg_alloc(struct ceph_connection *con,
2662 type, front_len); 2662 type, front_len);
2663 return false; 2663 return false;
2664 } 2664 }
2665 con->in_msg->con = ceph_con_get(con); 2665 con->in_msg->con = con->ops->get(con);
2666 BUG_ON(con->in_msg->con == NULL); 2666 BUG_ON(con->in_msg->con == NULL);
2667 con->in_msg->page_alignment = le16_to_cpu(hdr->data_off); 2667 con->in_msg->page_alignment = le16_to_cpu(hdr->data_off);
2668 } 2668 }