1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 * Portions Copyright (C) 2013 CohortFS, LLC
9 * This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1, as published by the Free Software
12 * Foundation. See file COPYING.
16 #include "XioMessenger.h"
17 #include "XioConnection.h"
21 int XioDispatchHook::release_msgs()
24 int r
= msg_seq
.size();
27 /* queue for release */
28 xcmp
= static_cast<XioCompletion
*>(rsp_pool
.alloc(sizeof(XioCompletion
)));
29 new (xcmp
) XioCompletion(xcon
, this);
30 xcmp
->trace
= m
->trace
;
32 /* merge with portal traffic */
33 xcon
->portal
->enqueue(xcon
, xcmp
);
39 /*static*/ size_t XioMsgHdr::get_max_encoded_length() {
40 ceph_msg_header _ceph_msg_header
;
41 ceph_msg_footer _ceph_msg_footer
;
42 XioMsgHdr
hdr (_ceph_msg_header
, _ceph_msg_footer
, 0 /* features */);
43 const std::list
<buffer::ptr
>& hdr_buffers
= hdr
.get_bl().buffers();
44 assert(hdr_buffers
.size() == 1); /* accelio header is small without scatter gather */
45 return hdr_buffers
.begin()->length();
48 void XioMsg::print_debug(CephContext
*cct
, const char *tag
) const {
49 print_xio_msg_hdr(cct
, tag
, hdr
, get_xio_msg());
50 print_ceph_msg(cct
, tag
, m
);