]>
Commit | Line | Data |
---|---|---|
a8e16298 TL |
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_MMDSFRAGMENTNOTIFYAck_H | |
16 | #define CEPH_MMDSFRAGMENTNOTIFYAck_H | |
17 | ||
f67539c2 | 18 | #include "messages/MMDSOp.h" |
a8e16298 | 19 | |
f67539c2 | 20 | class MMDSFragmentNotifyAck final : public MMDSOp { |
a8e16298 TL |
21 | private: |
22 | dirfrag_t base_dirfrag; | |
23 | int8_t bits = 0; | |
24 | ||
11fdf7f2 | 25 | public: |
a8e16298 TL |
26 | dirfrag_t get_base_dirfrag() const { return base_dirfrag; } |
27 | int get_bits() const { return bits; } | |
28 | ||
f67539c2 | 29 | ceph::buffer::list basebl; |
a8e16298 | 30 | |
11fdf7f2 | 31 | protected: |
f67539c2 | 32 | MMDSFragmentNotifyAck() : MMDSOp{MSG_MDS_FRAGMENTNOTIFYACK} {} |
a8e16298 | 33 | MMDSFragmentNotifyAck(dirfrag_t df, int b, uint64_t tid) : |
f67539c2 | 34 | MMDSOp{MSG_MDS_FRAGMENTNOTIFYACK}, |
a8e16298 TL |
35 | base_dirfrag(df), bits(b) { |
36 | set_tid(tid); | |
37 | } | |
f67539c2 | 38 | ~MMDSFragmentNotifyAck() final {} |
a8e16298 TL |
39 | |
40 | public: | |
11fdf7f2 | 41 | std::string_view get_type_name() const override { return "fragment_notify_ack"; } |
f67539c2 | 42 | void print(std::ostream& o) const override { |
a8e16298 TL |
43 | o << "fragment_notify_ack(" << base_dirfrag << " " << (int)bits << ")"; |
44 | } | |
45 | ||
46 | void encode_payload(uint64_t features) override { | |
11fdf7f2 TL |
47 | using ceph::encode; |
48 | encode(base_dirfrag, payload); | |
49 | encode(bits, payload); | |
a8e16298 TL |
50 | } |
51 | void decode_payload() override { | |
f67539c2 | 52 | using ceph::decode; |
11fdf7f2 TL |
53 | auto p = payload.cbegin(); |
54 | decode(base_dirfrag, p); | |
55 | decode(bits, p); | |
a8e16298 | 56 | } |
9f95a23c TL |
57 | private: |
58 | template<class T, typename... Args> | |
59 | friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args); | |
20effc67 TL |
60 | template<class T, typename... Args> |
61 | friend MURef<T> crimson::make_message(Args&&... args); | |
a8e16298 TL |
62 | }; |
63 | ||
64 | #endif |