From: Kefu Chai Date: Sat, 27 Dec 2014 07:04:00 +0000 (+0800) Subject: AsyncMessender: use IOV_MAX instead of IOV_LEN X-Git-Tag: v0.92~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3261%2Fhead;p=ceph.git AsyncMessender: use IOV_MAX instead of IOV_LEN Signed-off-by: Kefu Chai --- diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index c6a630182732..26552fffb847 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -307,7 +307,7 @@ int AsyncConnection::_try_send(bufferlist send_bl, bool send) uint64_t left_pbrs = outcoming_bl.buffers().size(); while (left_pbrs) { struct msghdr msg; - uint64_t size = MIN(left_pbrs, IOV_LEN); + uint64_t size = MIN(left_pbrs, sizeof(msgvec)); left_pbrs -= size; memset(&msg, 0, sizeof(msg)); msg.msg_iovlen = 0; diff --git a/src/msg/async/AsyncConnection.h b/src/msg/async/AsyncConnection.h index 348a87b90250..c3572c4f1713 100644 --- a/src/msg/async/AsyncConnection.h +++ b/src/msg/async/AsyncConnection.h @@ -18,6 +18,7 @@ #define CEPH_MSG_ASYNCCONNECTION_H #include +#include #include #include using namespace std; @@ -42,7 +43,6 @@ class AsyncMessenger; * sequence, try to reconnect peer endpoint. */ class AsyncConnection : public Connection { - const static uint64_t IOV_LEN = 1024; int read_bulk(int fd, char *buf, int len); int do_sendmsg(struct msghdr &msg, int len, bool more); @@ -262,7 +262,7 @@ class AsyncConnection : public Connection { EventCallbackRef signal_handler; EventCallbackRef local_deliver_handler; bool keepalive; - struct iovec msgvec[IOV_LEN]; + struct iovec msgvec[IOV_MAX]; Mutex stop_lock; // used to protect `mark_down_cond` Cond stop_cond; set register_time_events; // need to delete it if stop