These are usually small per io. Avoid an additional allocation.
Signed-off-by: Sage Weil <sage@redhat.com>
dout(20) << __func__ << " aio " << &aio << " fd " << aio.fd
<< " 0x" << std::hex << aio.offset << "~" << aio.length
<< std::dec << dendl;
- for (vector<iovec>::iterator q = aio.iov.begin(); q != aio.iov.end(); ++q)
- dout(30) << __func__ << " iov " << (void*)q->iov_base
- << " len " << q->iov_len << dendl;
+ for (auto& io : aio.iov)
+ dout(30) << __func__ << " iov " << (void*)io.iov_base
+ << " len " << io.iov_len << dendl;
// be careful: as soon as we submit aio we race with completion.
// since we are holding a ref take care not to dereference txc at
#include "common/Mutex.h"
#include "common/Cond.h"
#include <boost/intrusive/list.hpp>
+#include <boost/container/small_vector.hpp>
class FS {
public:
struct iocb iocb; // must be first element; see shenanigans in aio_queue_t
void *priv;
int fd;
- vector<iovec> iov;
+ boost::container::small_vector<iovec,4> iov;
uint64_t offset, length;
int rval;
bufferlist bl; ///< write payload (so that it remains stable for duration)