]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
xio: fix build (entity_addr_t encoding) 9636/head
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 10 Jun 2016 19:44:29 +0000 (15:44 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 10 Jun 2016 19:44:29 +0000 (15:44 -0400)
Currently XioMessenger encodes an entity_addr_t in its wire header.
The new 'features' argument to entity_addr_t::encode should have
the actual XioMessenger::local_features value when actually encoding
(and some value otherwise).

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/msg/xio/XioMessenger.cc
src/msg/xio/XioMsg.cc
src/msg/xio/XioMsg.h

index 0f191161dbab4cfaa700191c880d027ffa74bf47..bce31d3f9d55b021940a4b83454202edaf97163e 100644 (file)
@@ -775,7 +775,9 @@ static inline XioMsg* pool_alloc_xio_msg(Message *m, XioConnection *xcon,
     return NULL;
   XioMsg *xmsg = reinterpret_cast<XioMsg*>(mp_mem.addr);
   assert(!!xmsg);
-  new (xmsg) XioMsg(m, xcon, mp_mem, ex_cnt);
+  new (xmsg) XioMsg(m, xcon, mp_mem, ex_cnt,
+                   static_cast<XioMessenger*>(
+                     xcon->get_messenger())->local_features);
   return xmsg;
 }
 
index ef0ab6f5a8b3bda9dc918d822097b77703775c5e..cf7712d395080dbf9f8c6662ae61e3f7c42dbe49 100644 (file)
@@ -38,7 +38,7 @@ int XioDispatchHook::release_msgs()
 /*static*/ size_t XioMsgHdr::get_max_encoded_length() {
   ceph_msg_header _ceph_msg_header;
   ceph_msg_footer _ceph_msg_footer;
-  XioMsgHdr hdr (_ceph_msg_header, _ceph_msg_footer);
+  XioMsgHdr hdr (_ceph_msg_header, _ceph_msg_footer, 0 /* features */);
   const std::list<buffer::ptr>& hdr_buffers = hdr.get_bl().buffers();
   assert(hdr_buffers.size() == 1); /* accelio header is small without scatter gather */
   return hdr_buffers.begin()->length();
index eb9017b2cff25fb75761f48b3b9ac852635406f4..73d210df2da01ab4eff4e668ccdfc429dcc4eb22 100644 (file)
@@ -28,6 +28,8 @@ extern "C" {
 
 namespace bi = boost::intrusive;
 
+class XioMessenger;
+
 class XioMsgCnt
 {
 public:
@@ -51,10 +53,12 @@ public:
   entity_addr_t addr; /* XXX hack! */
   ceph_msg_header* hdr;
   ceph_msg_footer* ftr;
+  uint64_t features;
   buffer::list bl;
 public:
-  XioMsgHdr(ceph_msg_header& _hdr, ceph_msg_footer& _ftr)
-    : tag(CEPH_MSGR_TAG_MSG), msg_cnt(0), hdr(&_hdr), ftr(&_ftr)
+  XioMsgHdr(ceph_msg_header& _hdr, ceph_msg_footer& _ftr, uint64_t _features)
+    : tag(CEPH_MSGR_TAG_MSG), msg_cnt(0), hdr(&_hdr), ftr(&_ftr),
+      features(_features)
     { }
 
   XioMsgHdr(ceph_msg_header& _hdr, ceph_msg_footer &_ftr, buffer::ptr p)
@@ -69,11 +73,11 @@ public:
 
   const buffer::list& get_bl() { encode(bl); return bl; };
 
-  inline void encode_hdr(buffer::list& bl) const {
+  inline void encode_hdr(ceph::buffer::list& bl) const {
     ::encode(tag, bl);
     ::encode(msg_cnt, bl);
     ::encode(peer_type, bl);
-    ::encode(addr, bl);
+    ::encode(addr, bl, features);
     ::encode(hdr->seq, bl);
     ::encode(hdr->tid, bl);
     ::encode(hdr->type, bl);
@@ -248,9 +252,9 @@ public:
 
 public:
   XioMsg(Message *_m, XioConnection *_xcon, struct xio_reg_mem& _mp,
-        int _ex_cnt) :
+        int _ex_cnt, uint64_t _features) :
     XioSend(_xcon, _mp, _ex_cnt),
-    m(_m), hdr(m->get_header(), m->get_footer()),
+    m(_m), hdr(m->get_header(), m->get_footer(), _features),
     req_arr(NULL)
     {
       const entity_inst_t &inst = xcon->get_messenger()->get_myinst();