From: Kefu Chai Date: Thu, 26 Feb 2015 04:40:28 +0000 (+0800) Subject: msg/xio: do not reference g_conf and g_ceph_context X-Git-Tag: v9.0.0~213^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=652e85445d42fe75ae253befcad9546c5149e66b;p=ceph.git msg/xio: do not reference g_conf and g_ceph_context * otherwise librados and libcephfs will have dependencies on these global variables. because they enclose libmsg in them. * replace `derr` with ldout(cct,0) Fixes: #10735 Signed-off-by: Kefu Chai --- diff --git a/src/msg/xio/XioConnection.cc b/src/msg/xio/XioConnection.cc index a4d44d8c414..1738a663292 100644 --- a/src/msg/xio/XioConnection.cc +++ b/src/msg/xio/XioConnection.cc @@ -211,7 +211,7 @@ int XioConnection::on_msg_req(struct xio_session *session, if (! in_seq.p()) { if (!treq->in.header.iov_len) { - derr << __func__ << " empty header: packet out of sequence?" << dendl; + ldout(msgr->cct,0) << __func__ << " empty header: packet out of sequence?" << dendl; xio_release_msg(req); return 0; } @@ -657,9 +657,8 @@ int XioConnection::CState::state_discon() return 0; } -int XioConnection::CState::state_flow_controlled(uint32_t flags) { - dout(11) << __func__ << " ENTER " << dendl; - +int XioConnection::CState::state_flow_controlled(uint32_t flags) +{ if (! (flags & OP_FLAG_LOCKED)) pthread_spin_lock(&xcon->sp); diff --git a/src/msg/xio/XioMessenger.cc b/src/msg/xio/XioMessenger.cc index f5c650673e3..3fdb36e7453 100644 --- a/src/msg/xio/XioMessenger.cc +++ b/src/msg/xio/XioMessenger.cc @@ -644,26 +644,26 @@ int XioMessenger::bind(const entity_addr_t& addr) if (a->is_blank_ip()) { a = &_addr; std::vector my_sections; - g_conf->get_my_sections(my_sections); + cct->_conf->get_my_sections(my_sections); std::string rdma_local_str; - if (g_conf->get_val_from_conf_file(my_sections, "rdma local", + if (cct->_conf->get_val_from_conf_file(my_sections, "rdma local", rdma_local_str, true) == 0) { struct entity_addr_t local_rdma_addr; local_rdma_addr = *a; const char *ep; if (!local_rdma_addr.parse(rdma_local_str.c_str(), &ep)) { - derr << "ERROR: Cannot parse rdma local: " << rdma_local_str << dendl; + ldout(cct,0) << "ERROR: Cannot parse rdma local: " << rdma_local_str << dendl; return -EINVAL; } if (*ep) { - derr << "WARNING: 'rdma local trailing garbage ignored: '" << ep << dendl; + ldout(cct,0) << "WARNING: 'rdma local trailing garbage ignored: '" << ep << dendl; } int p = _addr.get_port(); _addr.set_sockaddr(reinterpret_cast( &local_rdma_addr.ss_addr())); _addr.set_port(p); } else { - derr << "WARNING: need 'rdma local' config for remote use!" <