aboutsummaryrefslogtreecommitdiff
path: root/net/ceph/mon_client.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-05-26 23:26:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 11:38:23 -0800
commit6880138c03448b3c375a3d7a8ef6acd688e6fb40 (patch)
tree32fcab0d28584b1ba13756cbdfd4f870065ecd69 /net/ceph/mon_client.c
parent9403ae33bf946342b23cfe3dbf3e4c9b86860c97 (diff)
libceph: fully initialize connection in con_init()
(cherry picked from commit 1bfd89f4e6e1adc6a782d94aa5d4c53be1e404d7) Move the initialization of a ceph connection's private pointer, operations vector pointer, and peer name information into ceph_con_init(). Rearrange the arguments so the connection pointer is first. Hide the byte-swapping of the peer entity number inside ceph_con_init() Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ceph/mon_client.c')
-rw-r--r--net/ceph/mon_client.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index 1b03493f874..d3c22b7218c 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -142,11 +142,9 @@ static int __open_session(struct ceph_mon_client *monc)
monc->sub_renew_after = jiffies; /* i.e., expired */
monc->want_next_osdmap = !!monc->want_next_osdmap;
- ceph_con_init(&monc->client->msgr, &monc->con);
- monc->con.private = monc;
- monc->con.ops = &mon_con_ops;
- monc->con.peer_name.type = CEPH_ENTITY_TYPE_MON;
- monc->con.peer_name.num = cpu_to_le64(monc->cur_mon);
+ ceph_con_init(&monc->con, monc, &mon_con_ops,
+ &monc->client->msgr,
+ CEPH_ENTITY_TYPE_MON, monc->cur_mon);
dout("open_session mon%d opening\n", monc->cur_mon);
ceph_con_open(&monc->con,