]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMDSFindIno.h
Import ceph 15.2.8
[ceph.git] / ceph / src / messages / MMDSFindIno.h
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_MDSFINDINO_H
16 #define CEPH_MDSFINDINO_H
17
18 #include "msg/Message.h"
19 #include "include/filepath.h"
20
21 class MMDSFindIno : public SafeMessage {
22 static const int HEAD_VERSION = 1;
23 static const int COMPAT_VERSION = 1;
24 public:
25 ceph_tid_t tid {0};
26 inodeno_t ino;
27
28 protected:
29 MMDSFindIno() : SafeMessage{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION} {}
30 MMDSFindIno(ceph_tid_t t, inodeno_t i) : SafeMessage{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION}, tid(t), ino(i) {}
31 ~MMDSFindIno() override {}
32
33 public:
34 std::string_view get_type_name() const override { return "findino"; }
35 void print(ostream &out) const override {
36 out << "findino(" << tid << " " << ino << ")";
37 }
38
39 void encode_payload(uint64_t features) override {
40 using ceph::encode;
41 encode(tid, payload);
42 encode(ino, payload);
43 }
44 void decode_payload() override {
45 auto p = payload.cbegin();
46 decode(tid, p);
47 decode(ino, p);
48 }
49 private:
50 template<class T, typename... Args>
51 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
52 };
53
54 #endif