src/msg/xio/*: reduce scope of some vars

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2015-03-05 06:36:15 +01:00
parent 6f79e4a616
commit 778e0ef10d
2 changed files with 9 additions and 12 deletions

View File

@ -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<buffer::ptr>& buffers = bl.buffers();
list<bufferptr>::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<buffer::ptr>& buffers = bl.buffers();
list<bufferptr>::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);
}

View File

@ -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();
}
}