]>
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 | ||
18 | #include "msg/Message.h" | |
19 | ||
11fdf7f2 TL |
20 | class MMDSFragmentNotifyAck : public MessageInstance<MMDSFragmentNotifyAck> { |
21 | public: | |
22 | friend factory; | |
a8e16298 TL |
23 | private: |
24 | dirfrag_t base_dirfrag; | |
25 | int8_t bits = 0; | |
26 | ||
11fdf7f2 | 27 | public: |
a8e16298 TL |
28 | dirfrag_t get_base_dirfrag() const { return base_dirfrag; } |
29 | int get_bits() const { return bits; } | |
30 | ||
31 | bufferlist basebl; | |
32 | ||
11fdf7f2 TL |
33 | protected: |
34 | MMDSFragmentNotifyAck() : MessageInstance(MSG_MDS_FRAGMENTNOTIFYACK) {} | |
a8e16298 | 35 | MMDSFragmentNotifyAck(dirfrag_t df, int b, uint64_t tid) : |
11fdf7f2 | 36 | MessageInstance(MSG_MDS_FRAGMENTNOTIFYACK), |
a8e16298 TL |
37 | base_dirfrag(df), bits(b) { |
38 | set_tid(tid); | |
39 | } | |
a8e16298 TL |
40 | ~MMDSFragmentNotifyAck() override {} |
41 | ||
42 | public: | |
11fdf7f2 | 43 | std::string_view get_type_name() const override { return "fragment_notify_ack"; } |
a8e16298 TL |
44 | void print(ostream& o) const override { |
45 | o << "fragment_notify_ack(" << base_dirfrag << " " << (int)bits << ")"; | |
46 | } | |
47 | ||
48 | void encode_payload(uint64_t features) override { | |
11fdf7f2 TL |
49 | using ceph::encode; |
50 | encode(base_dirfrag, payload); | |
51 | encode(bits, payload); | |
a8e16298 TL |
52 | } |
53 | void decode_payload() override { | |
11fdf7f2 TL |
54 | auto p = payload.cbegin(); |
55 | decode(base_dirfrag, p); | |
56 | decode(bits, p); | |
a8e16298 TL |
57 | } |
58 | }; | |
59 | ||
60 | #endif |