]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MMDSFindIno.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MMDSFindIno.h
CommitLineData
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_MDSFINDINO_H
16#define CEPH_MDSFINDINO_H
17
7c673cae 18#include "include/filepath.h"
f67539c2 19#include "messages/MMDSOp.h"
7c673cae 20
f67539c2
TL
21class MMDSFindIno final : public MMDSOp {
22 static constexpr int HEAD_VERSION = 1;
23 static constexpr int COMPAT_VERSION = 1;
11fdf7f2 24public:
11fdf7f2 25 ceph_tid_t tid {0};
7c673cae
FG
26 inodeno_t ino;
27
11fdf7f2 28protected:
f67539c2
TL
29 MMDSFindIno() : MMDSOp{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION} {}
30 MMDSFindIno(ceph_tid_t t, inodeno_t i) : MMDSOp{MSG_MDS_FINDINO, HEAD_VERSION, COMPAT_VERSION}, tid(t), ino(i) {}
31 ~MMDSFindIno() final {}
7c673cae 32
11fdf7f2
TL
33public:
34 std::string_view get_type_name() const override { return "findino"; }
f67539c2 35 void print(std::ostream &out) const override {
7c673cae
FG
36 out << "findino(" << tid << " " << ino << ")";
37 }
38
39 void encode_payload(uint64_t features) override {
11fdf7f2
TL
40 using ceph::encode;
41 encode(tid, payload);
42 encode(ino, 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(ino, p);
7c673cae 49 }
9f95a23c
TL
50private:
51 template<class T, typename... Args>
52 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
7c673cae
FG
53};
54
55#endif