]>
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) 2011 New Dream Network | |
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_MDSFINDINOREPLY_H | |
16 | #define CEPH_MDSFINDINOREPLY_H | |
17 | ||
7c673cae | 18 | #include "include/filepath.h" |
f67539c2 | 19 | #include "messages/MMDSOp.h" |
7c673cae | 20 | |
f67539c2 TL |
21 | class MMDSFindInoReply final : public MMDSOp { |
22 | static constexpr int HEAD_VERSION = 1; | |
23 | static constexpr int COMPAT_VERSION = 1; | |
11fdf7f2 | 24 | public: |
11fdf7f2 | 25 | ceph_tid_t tid = 0; |
7c673cae FG |
26 | filepath path; |
27 | ||
11fdf7f2 | 28 | protected: |
f67539c2 TL |
29 | MMDSFindInoReply() : MMDSOp{MSG_MDS_FINDINOREPLY, HEAD_VERSION, COMPAT_VERSION} {} |
30 | MMDSFindInoReply(ceph_tid_t t) : MMDSOp{MSG_MDS_FINDINOREPLY, HEAD_VERSION, COMPAT_VERSION}, tid(t) {} | |
31 | ~MMDSFindInoReply() final {} | |
7c673cae | 32 | |
11fdf7f2 TL |
33 | public: |
34 | std::string_view get_type_name() const override { return "findinoreply"; } | |
f67539c2 | 35 | void print(std::ostream &out) const override { |
7c673cae FG |
36 | out << "findinoreply(" << tid << " " << path << ")"; |
37 | } | |
f67539c2 | 38 | |
7c673cae | 39 | void encode_payload(uint64_t features) override { |
11fdf7f2 TL |
40 | using ceph::encode; |
41 | encode(tid, payload); | |
42 | encode(path, payload); | |
7c673cae FG |
43 | } |
44 | void decode_payload() override { | |
f67539c2 | 45 | using ceph::decode; |
11fdf7f2 TL |
46 | auto p = payload.cbegin(); |
47 | decode(tid, p); | |
48 | decode(path, p); | |
7c673cae | 49 | } |
9f95a23c TL |
50 | private: |
51 | template<class T, typename... Args> | |
52 | friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args); | |
20effc67 TL |
53 | template<class T, typename... Args> |
54 | friend MURef<T> crimson::make_message(Args&&... args); | |
7c673cae FG |
55 | }; |
56 | ||
57 | #endif |