]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MExportDirCancel.h
bump version to 15.2.11-pve1
[ceph.git] / ceph / src / messages / MExportDirCancel.h
CommitLineData
7c673cae
FG
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 "msg/Message.h"
19#include "include/types.h"
20
9f95a23c 21class MExportDirCancel : public SafeMessage {
11fdf7f2 22private:
9f95a23c
TL
23 static const int HEAD_VERSION = 1;
24 static const int COMPAT_VERSION = 1;
7c673cae
FG
25 dirfrag_t dirfrag;
26
27 public:
11fdf7f2 28 dirfrag_t get_dirfrag() const { return dirfrag; }
7c673cae 29
11fdf7f2 30protected:
9f95a23c 31 MExportDirCancel() : SafeMessage{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION} {}
7c673cae 32 MExportDirCancel(dirfrag_t df, uint64_t tid) :
9f95a23c 33 SafeMessage{MSG_MDS_EXPORTDIRCANCEL, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df) {
7c673cae
FG
34 set_tid(tid);
35 }
7c673cae
FG
36 ~MExportDirCancel() override {}
37
38public:
11fdf7f2 39 std::string_view get_type_name() const override { return "ExCancel"; }
7c673cae
FG
40 void print(ostream& o) const override {
41 o << "export_cancel(" << dirfrag << ")";
42 }
43
44 void encode_payload(uint64_t features) override {
11fdf7f2
TL
45 using ceph::encode;
46 encode(dirfrag, payload);
7c673cae
FG
47 }
48 void decode_payload() override {
11fdf7f2
TL
49 auto p = payload.cbegin();
50 decode(dirfrag, p);
7c673cae 51 }
9f95a23c
TL
52private:
53 template<class T, typename... Args>
54 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
7c673cae
FG
55};
56
57#endif