]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
AsyncMessender: use IOV_MAX instead of IOV_LEN 3261/head
authorKefu Chai <tchaikov@gmail.com>
Sat, 27 Dec 2014 07:04:00 +0000 (15:04 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 31 Dec 2014 02:45:00 +0000 (10:45 +0800)
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/msg/async/AsyncConnection.cc
src/msg/async/AsyncConnection.h

index c6a63018273212b88d6cbd418ce7c80563126f96..26552fffb847ecb664de0551bf8ee74a054e52f4 100644 (file)
@@ -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;
index 348a87b90250e67267d0436dbdeeadaf7d7f7113..c3572c4f17131a86efbad8e4705550fa9a741d3a 100644 (file)
@@ -18,6 +18,7 @@
 #define CEPH_MSG_ASYNCCONNECTION_H
 
 #include <pthread.h>
+#include <climits>
 #include <list>
 #include <map>
 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<uint64_t> register_time_events; // need to delete it if stop