libceph: set peer name on con_open, not init
[deliverable/linux.git] / net / ceph / messenger.c
index dcc50e4cd5cd704cb05d9191ff1eed22526d1835..ae082d95fc726fd7369a39234acad4df228cb6f5 100644 (file)
@@ -523,12 +523,17 @@ EXPORT_SYMBOL(ceph_con_close);
 /*
  * Reopen a closed connection, with a new peer address.
  */
-void ceph_con_open(struct ceph_connection *con, struct ceph_entity_addr *addr)
+void ceph_con_open(struct ceph_connection *con,
+                  __u8 entity_type, __u64 entity_num,
+                  struct ceph_entity_addr *addr)
 {
        dout("con_open %p %s\n", con, ceph_pr_addr(&addr->in_addr));
        set_bit(OPENING, &con->state);
        WARN_ON(!test_and_clear_bit(CLOSED, &con->state));
 
+       con->peer_name.type = (__u8) entity_type;
+       con->peer_name.num = cpu_to_le64(entity_num);
+
        memcpy(&con->peer_addr, addr, sizeof(*addr));
        con->delay = 0;      /* reset backoff memory */
        queue_con(con);
@@ -548,7 +553,7 @@ bool ceph_con_opened(struct ceph_connection *con)
  */
 void ceph_con_init(struct ceph_connection *con, void *private,
        const struct ceph_connection_operations *ops,
-       struct ceph_messenger *msgr, __u8 entity_type, __u64 entity_num)
+       struct ceph_messenger *msgr)
 {
        dout("con_init %p\n", con);
        memset(con, 0, sizeof(*con));
@@ -558,9 +563,6 @@ void ceph_con_init(struct ceph_connection *con, void *private,
 
        con_sock_state_init(con);
 
-       con->peer_name.type = (__u8) entity_type;
-       con->peer_name.num = cpu_to_le64(entity_num);
-
        mutex_init(&con->mutex);
        INIT_LIST_HEAD(&con->out_queue);
        INIT_LIST_HEAD(&con->out_sent);
This page took 0.030044 seconds and 5 git commands to generate.