diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/msg/xio/XioMsg.cc | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/msg/xio/XioMsg.cc')
-rw-r--r-- | src/msg/xio/XioMsg.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/msg/xio/XioMsg.cc b/src/msg/xio/XioMsg.cc new file mode 100644 index 00000000..4b6a5d68 --- /dev/null +++ b/src/msg/xio/XioMsg.cc @@ -0,0 +1,51 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net> + * Portions Copyright (C) 2013 CohortFS, LLC + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#include "XioMessenger.h" +#include "XioConnection.h" +#include "XioMsg.h" + + +int XioDispatchHook::release_msgs() +{ + XioCompletion *xcmp; + int r = msg_seq.size(); + cl_flag = true; + + /* queue for release */ + xcmp = static_cast<XioCompletion *>(rsp_pool.alloc(sizeof(XioCompletion))); + new (xcmp) XioCompletion(xcon, this); + xcmp->trace = m->trace; + + /* merge with portal traffic */ + xcon->portal->enqueue(xcon, xcmp); + + ceph_assert(r); + return r; +} + +/*static*/ size_t XioMsgHdr::get_max_encoded_length() { + ceph_msg_header _ceph_msg_header; + ceph_msg_footer _ceph_msg_footer; + XioMsgHdr hdr (_ceph_msg_header, _ceph_msg_footer, 0 /* features */); + const std::list<buffer::ptr>& hdr_buffers = hdr.get_bl().buffers(); + ceph_assert(hdr_buffers.size() == 1); /* accelio header is small without scatter gather */ + return hdr_buffers.begin()->length(); +} + +void XioMsg::print_debug(CephContext *cct, const char *tag) const { + print_xio_msg_hdr(cct, tag, hdr, get_xio_msg()); + print_ceph_msg(cct, tag, m); +} |