From: Vu Pham Date: Thu, 5 Feb 2015 10:38:26 +0000 (-0800) Subject: xio: Squash the whitespaces X-Git-Tag: v0.93~86^2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bb18d01aae318c2e9e663ee1e0c8f0937fb54722;p=ceph.git xio: Squash the whitespaces Signed-off-by: Vu Pham --- diff --git a/src/msg/xio/XioPortal.h b/src/msg/xio/XioPortal.h index fdc197230b93..148f09b919c9 100644 --- a/src/msg/xio/XioPortal.h +++ b/src/msg/xio/XioPortal.h @@ -348,30 +348,30 @@ private: public: XioPortals(Messenger *msgr, int _n) : p_vec(NULL) - { - /* portal0 */ - portals.push_back(new XioPortal(msgr)); - last_use = 0; + { + /* portal0 */ + portals.push_back(new XioPortal(msgr)); + last_use = 0; - /* enforce at least two portals if bind */ - if (_n < 2) - _n = 2; - n = _n; + /* enforce at least two portals if bind */ + if (_n < 2) + _n = 2; + n = _n; - /* additional portals allocated on bind() */ - } + /* additional portals allocated on bind() */ + } vector& get() { return portals; } const char **get_vec() - { - return (const char **) p_vec; - } + { + return (const char **) p_vec; + } int get_portals_len() - { - return n; - } + { + return n; + } int get_last_use() { @@ -382,78 +382,76 @@ public: } XioPortal* get_portal0() - { - return portals[0]; - } + { + return portals[0]; + } int bind(struct xio_session_ops *ops, const string& base_uri, uint16_t port, uint16_t *port0); - int accept(struct xio_session *session, - struct xio_new_session_req *req, - void *cb_user_context) - { - const char **portals_vec = get_vec(); - int pix = get_last_use(); + int accept(struct xio_session *session, + struct xio_new_session_req *req, + void *cb_user_context) + { + const char **portals_vec = get_vec(); + int pix = get_last_use(); - return xio_accept(session, - (const char **)&(portals_vec[pix]), - 1, NULL, 0); - } + return xio_accept(session, + (const char **)&(portals_vec[pix]), + 1, NULL, 0); + } void start() - { - XioPortal *portal; - int p_ix, nportals = portals.size(); - - /* portal_0 is the new-session handler, portal_1+ terminate - * active sessions */ - - p_vec = new char*[(nportals-1)]; - for (p_ix = 1; p_ix < nportals; ++p_ix) { - portal = portals[p_ix]; - /* shift left */ - p_vec[(p_ix-1)] = (char*) /* portal->xio_uri.c_str() */ - portal->portal_id; + { + XioPortal *portal; + int p_ix, nportals = portals.size(); + + /* portal_0 is the new-session handler, portal_1+ terminate + * active sessions */ + + p_vec = new char*[(nportals-1)]; + for (p_ix = 1; p_ix < nportals; ++p_ix) { + portal = portals[p_ix]; + /* shift left */ + p_vec[(p_ix-1)] = (char*) /* portal->xio_uri.c_str() */ + portal->portal_id; } - for (p_ix = 0; p_ix < nportals; ++p_ix) { - portal = portals[p_ix]; - portal->create(); - } + for (p_ix = 0; p_ix < nportals; ++p_ix) { + portal = portals[p_ix]; + portal->create(); } + } void shutdown() - { - XioPortal *portal; - int nportals = portals.size(); - for (int p_ix = 0; p_ix < nportals; ++p_ix) { - portal = portals[p_ix]; - portal->shutdown(); - } + { + XioPortal *portal; + int nportals = portals.size(); + for (int p_ix = 0; p_ix < nportals; ++p_ix) { + 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]; - portal->join(); - } + { + XioPortal *portal; + int nportals = portals.size(); + for (int p_ix = 0; p_ix < nportals; ++p_ix) { + portal = portals[p_ix]; + portal->join(); } + } ~XioPortals() - { - int nportals = portals.size(); - for (int ix = 0; ix < nportals; ++ix) { - delete(portals[ix]); - } - portals.clear(); - if (p_vec) { - delete[] p_vec; - } - } + { + int nportals = portals.size(); + for (int ix = 0; ix < nportals; ++ix) + delete(portals[ix]); + portals.clear(); + if (p_vec) + delete[] p_vec; + } }; #endif /* XIO_PORTAL_H */