From: Danny Al-Gaaf Date: Thu, 5 Mar 2015 05:36:15 +0000 (+0100) Subject: src/msg/xio/*: reduce scope of some vars X-Git-Tag: v9.0.0~186^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=778e0ef10d91c66c3b2c5abd115cf44c9c43b45f;p=ceph.git src/msg/xio/*: reduce scope of some vars Signed-off-by: Danny Al-Gaaf --- diff --git a/src/msg/xio/XioMessenger.cc b/src/msg/xio/XioMessenger.cc index 3fdb36e7453..f084cfeb0cb 100644 --- a/src/msg/xio/XioMessenger.cc +++ b/src/msg/xio/XioMessenger.cc @@ -138,8 +138,8 @@ static int on_msg(struct xio_session *session, ldout(cct,25) << "on_msg session " << session << " xcon " << xcon << dendl; - static uint32_t nreqs; if (unlikely(XioPool::trace_mempool)) { + static uint32_t nreqs; if (unlikely((++nreqs % 65536) == 0)) { xp_stats.dump(__func__, nreqs); } @@ -525,7 +525,7 @@ xio_count_buffers(buffer::list& bl, int& req_size, int& msg_off, int& req_off) const std::list& buffers = bl.buffers(); list::const_iterator pb; - size_t size, off, count; + size_t size, off; int result; int first = 1; @@ -541,7 +541,7 @@ xio_count_buffers(buffer::list& bl, int& req_size, int& msg_off, int& req_off) size = pb->length(); first = 0; } - count = size - off; + size_t count = size - off; if (!count) continue; if (req_size + count > MAX_XIO_BUF_SIZE) { count = MAX_XIO_BUF_SIZE - req_size; @@ -573,7 +573,7 @@ xio_place_buffers(buffer::list& bl, XioMsg *xmsg, struct xio_msg*& req, const std::list& buffers = bl.buffers(); list::const_iterator pb; struct xio_iovec_ex* iov; - size_t size, off, count; + size_t size, off; const char *data = NULL; int first = 1; @@ -589,7 +589,7 @@ xio_place_buffers(buffer::list& bl, XioMsg *xmsg, struct xio_msg*& req, data = pb->c_str(); // is c_str() efficient? first = 0; } - count = size - off; + size_t count = size - off; if (!count) continue; if (req_size + count > MAX_XIO_BUF_SIZE) { count = MAX_XIO_BUF_SIZE - req_size; @@ -755,9 +755,9 @@ int XioMessenger::_send_message_impl(Message* m, XioConnection* xcon) { int code = 0; - static uint32_t nreqs; Mutex::Locker l(xcon->lock); if (unlikely(XioPool::trace_mempool)) { + static uint32_t nreqs; if (unlikely((++nreqs % 65536) == 0)) { xp_stats.dump(__func__, nreqs); } diff --git a/src/msg/xio/XioPortal.h b/src/msg/xio/XioPortal.h index aaa26f92632..ea644a9f987 100644 --- a/src/msg/xio/XioPortal.h +++ b/src/msg/xio/XioPortal.h @@ -208,11 +208,10 @@ public: // and push them in FIFO order to front of the input queue, // and mark the connection as flow-controlled XioSubmit::Queue requeue_q; - XioSubmit *xs; XioMsg *xmsg; while (q_iter != send_q.end()) { - xs = &(*q_iter); + XioSubmit *xs = &(*q_iter); // skip retires and anything for other connections if ((xs->type != XioSubmit::OUTGOING_MSG) || (xs->xcon != xcon)) @@ -424,20 +423,18 @@ public: void shutdown() { - XioPortal *portal; int nportals = portals.size(); for (int p_ix = 0; p_ix < nportals; ++p_ix) { - portal = portals[p_ix]; + XioPortal *portal = portals[p_ix]; portal->shutdown(); } } void join() { - XioPortal *portal; int nportals = portals.size(); for (int p_ix = 0; p_ix < nportals; ++p_ix) { - portal = portals[p_ix]; + XioPortal *portal = portals[p_ix]; portal->join(); } }