diff options
-rw-r--r-- | fs/ceph/mds_client.c | 7 | ||||
-rw-r--r-- | include/linux/ceph/messenger.h | 6 | ||||
-rw-r--r-- | net/ceph/messenger.c | 9 | ||||
-rw-r--r-- | net/ceph/mon_client.c | 8 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 7 |
5 files changed, 19 insertions, 18 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index ad30261cd4c0..ecd7f15741c1 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -394,11 +394,8 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc, | |||
394 | s->s_seq = 0; | 394 | s->s_seq = 0; |
395 | mutex_init(&s->s_mutex); | 395 | mutex_init(&s->s_mutex); |
396 | 396 | ||
397 | ceph_con_init(&mdsc->fsc->client->msgr, &s->s_con); | 397 | ceph_con_init(&s->s_con, s, &mds_con_ops, &mdsc->fsc->client->msgr, |
398 | s->s_con.private = s; | 398 | CEPH_ENTITY_TYPE_MDS, mds); |
399 | s->s_con.ops = &mds_con_ops; | ||
400 | s->s_con.peer_name.type = CEPH_ENTITY_TYPE_MDS; | ||
401 | s->s_con.peer_name.num = cpu_to_le64(mds); | ||
402 | 399 | ||
403 | spin_lock_init(&s->s_gen_ttl_lock); | 400 | spin_lock_init(&s->s_gen_ttl_lock); |
404 | s->s_cap_gen = 0; | 401 | s->s_cap_gen = 0; |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 5e852f444f68..dd27837f79ac 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -227,8 +227,10 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr, | |||
227 | u32 required_features, | 227 | u32 required_features, |
228 | bool nocrc); | 228 | bool nocrc); |
229 | 229 | ||
230 | extern void ceph_con_init(struct ceph_messenger *msgr, | 230 | extern void ceph_con_init(struct ceph_connection *con, void *private, |
231 | struct ceph_connection *con); | 231 | const struct ceph_connection_operations *ops, |
232 | struct ceph_messenger *msgr, __u8 entity_type, | ||
233 | __u64 entity_num); | ||
232 | extern void ceph_con_open(struct ceph_connection *con, | 234 | extern void ceph_con_open(struct ceph_connection *con, |
233 | struct ceph_entity_addr *addr); | 235 | struct ceph_entity_addr *addr); |
234 | extern bool ceph_con_opened(struct ceph_connection *con); | 236 | extern bool ceph_con_opened(struct ceph_connection *con); |
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 36b440a00cc2..3b65f6e6911b 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -521,15 +521,22 @@ void ceph_con_put(struct ceph_connection *con) | |||
521 | /* | 521 | /* |
522 | * initialize a new connection. | 522 | * initialize a new connection. |
523 | */ | 523 | */ |
524 | void ceph_con_init(struct ceph_messenger *msgr, struct ceph_connection *con) | 524 | void ceph_con_init(struct ceph_connection *con, void *private, |
525 | const struct ceph_connection_operations *ops, | ||
526 | struct ceph_messenger *msgr, __u8 entity_type, __u64 entity_num) | ||
525 | { | 527 | { |
526 | dout("con_init %p\n", con); | 528 | dout("con_init %p\n", con); |
527 | memset(con, 0, sizeof(*con)); | 529 | memset(con, 0, sizeof(*con)); |
530 | con->private = private; | ||
531 | con->ops = ops; | ||
528 | atomic_set(&con->nref, 1); | 532 | atomic_set(&con->nref, 1); |
529 | con->msgr = msgr; | 533 | con->msgr = msgr; |
530 | 534 | ||
531 | con_sock_state_init(con); | 535 | con_sock_state_init(con); |
532 | 536 | ||
537 | con->peer_name.type = (__u8) entity_type; | ||
538 | con->peer_name.num = cpu_to_le64(entity_num); | ||
539 | |||
533 | mutex_init(&con->mutex); | 540 | mutex_init(&con->mutex); |
534 | INIT_LIST_HEAD(&con->out_queue); | 541 | INIT_LIST_HEAD(&con->out_queue); |
535 | INIT_LIST_HEAD(&con->out_sent); | 542 | INIT_LIST_HEAD(&con->out_sent); |
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index 6adbea78b168..ab6b24a5169e 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) | |||
142 | monc->sub_renew_after = jiffies; /* i.e., expired */ | 142 | monc->sub_renew_after = jiffies; /* i.e., expired */ |
143 | monc->want_next_osdmap = !!monc->want_next_osdmap; | 143 | monc->want_next_osdmap = !!monc->want_next_osdmap; |
144 | 144 | ||
145 | ceph_con_init(&monc->client->msgr, &monc->con); | 145 | ceph_con_init(&monc->con, monc, &mon_con_ops, |
146 | monc->con.private = monc; | 146 | &monc->client->msgr, |
147 | monc->con.ops = &mon_con_ops; | 147 | CEPH_ENTITY_TYPE_MON, monc->cur_mon); |
148 | monc->con.peer_name.type = CEPH_ENTITY_TYPE_MON; | ||
149 | monc->con.peer_name.num = cpu_to_le64(monc->cur_mon); | ||
150 | 148 | ||
151 | dout("open_session mon%d opening\n", monc->cur_mon); | 149 | dout("open_session mon%d opening\n", monc->cur_mon); |
152 | ceph_con_open(&monc->con, | 150 | ceph_con_open(&monc->con, |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 5b41a6929cd9..448c9da8beff 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -640,11 +640,8 @@ static struct ceph_osd *create_osd(struct ceph_osd_client *osdc, int onum) | |||
640 | INIT_LIST_HEAD(&osd->o_osd_lru); | 640 | INIT_LIST_HEAD(&osd->o_osd_lru); |
641 | osd->o_incarnation = 1; | 641 | osd->o_incarnation = 1; |
642 | 642 | ||
643 | ceph_con_init(&osdc->client->msgr, &osd->o_con); | 643 | ceph_con_init(&osd->o_con, osd, &osd_con_ops, &osdc->client->msgr, |
644 | osd->o_con.private = osd; | 644 | CEPH_ENTITY_TYPE_OSD, onum); |
645 | osd->o_con.ops = &osd_con_ops; | ||
646 | osd->o_con.peer_name.type = CEPH_ENTITY_TYPE_OSD; | ||
647 | osd->o_con.peer_name.num = cpu_to_le64(onum); | ||
648 | 645 | ||
649 | INIT_LIST_HEAD(&osd->o_keepalive_item); | 646 | INIT_LIST_HEAD(&osd->o_keepalive_item); |
650 | return osd; | 647 | return osd; |