]>
Commit | Line | Data |
---|---|---|
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 | ||
11fdf7f2 TL |
21 | class MExportDirCancel : public MessageInstance<MExportDirCancel> { |
22 | public: | |
23 | friend factory; | |
24 | private: | |
7c673cae FG |
25 | dirfrag_t dirfrag; |
26 | ||
27 | public: | |
11fdf7f2 | 28 | dirfrag_t get_dirfrag() const { return dirfrag; } |
7c673cae | 29 | |
11fdf7f2 TL |
30 | protected: |
31 | MExportDirCancel() : MessageInstance(MSG_MDS_EXPORTDIRCANCEL) {} | |
7c673cae | 32 | MExportDirCancel(dirfrag_t df, uint64_t tid) : |
11fdf7f2 | 33 | MessageInstance(MSG_MDS_EXPORTDIRCANCEL), dirfrag(df) { |
7c673cae FG |
34 | set_tid(tid); |
35 | } | |
7c673cae FG |
36 | ~MExportDirCancel() override {} |
37 | ||
38 | public: | |
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 FG |
51 | } |
52 | }; | |
53 | ||
54 | #endif |