]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MExportDirCancel.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MExportDirCancel.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 #ifndef CEPH_MEXPORTDIRCANCEL_H
16 #define CEPH_MEXPORTDIRCANCEL_H
17
18 #include "include/types.h"
19 #include "messages/MMDSOp.h"
20
21 class MExportDirCancel final : public MMDSOp {
22 private:
23 static constexpr int HEAD_VERSION = 1;
24 static constexpr int COMPAT_VERSION = 1;
25 dirfrag_t dirfrag;
26
27 public:
28 dirfrag_t get_dirfrag() const { return dirfrag; }
29
30 protected:
31 MExportDirCancel() : MMDSOp{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION} {}
32 MExportDirCancel(dirfrag_t df, uint64_t tid) :
33 MMDSOp{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df) {
34 set_tid(tid);
35 }
36 ~MExportDirCancel() final {}
37
38 public:
39 std::string_view get_type_name() const override { return "ExCancel"; }
40 void print(std::ostream& o) const override {
41 o << "export_cancel(" << dirfrag << ")";
42 }
43
44 void encode_payload(uint64_t features) override {
45 using ceph::encode;
46 encode(dirfrag, payload);
47 }
48 void decode_payload() override {
49 using ceph::decode;
50 auto p = payload.cbegin();
51 decode(dirfrag, p);
52 }
53 private:
54 template<class T, typename... Args>
55 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
56 };
57
58 #endif