]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMDSTableRequest.h
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / messages / MMDSTableRequest.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14
15
16 #ifndef CEPH_MMDSTABLEREQUEST_H
17 #define CEPH_MMDSTABLEREQUEST_H
18
19 #include "mds/mds_table_types.h"
20 #include "messages/MMDSOp.h"
21
22 class MMDSTableRequest final : public MMDSOp {
23 public:
24 __u16 table = 0;
25 __s16 op = 0;
26 uint64_t reqid = 0;
27 ceph::buffer::list bl;
28
29 protected:
30 MMDSTableRequest() : MMDSOp{MSG_MDS_TABLE_REQUEST} {}
31 MMDSTableRequest(int tab, int o, uint64_t r, version_t v=0) :
32 MMDSOp{MSG_MDS_TABLE_REQUEST},
33 table(tab), op(o), reqid(r) {
34 set_tid(v);
35 }
36 ~MMDSTableRequest() final {}
37
38 public:
39 std::string_view get_type_name() const override { return "mds_table_request"; }
40 void print(std::ostream& o) const override {
41 o << "mds_table_request(" << get_mdstable_name(table)
42 << " " << get_mdstableserver_opname(op);
43 if (reqid) o << " " << reqid;
44 if (get_tid()) o << " tid " << get_tid();
45 if (bl.length()) o << " " << bl.length() << " bytes";
46 o << ")";
47 }
48
49 void decode_payload() override {
50 using ceph::decode;
51 auto p = payload.cbegin();
52 decode(table, p);
53 decode(op, p);
54 decode(reqid, p);
55 decode(bl, p);
56 }
57
58 void encode_payload(uint64_t features) override {
59 using ceph::encode;
60 encode(table, payload);
61 encode(op, payload);
62 encode(reqid, payload);
63 encode(bl, payload);
64 }
65 private:
66 template<class T, typename... Args>
67 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
68 template<class T, typename... Args>
69 friend MURef<T> crimson::make_message(Args&&... args);
70 };
71
72 #endif