]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MMDSFindIno.h
import 15.2.0 Octopus source
[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
18#include "msg/Message.h"
19#include "include/filepath.h"
20
9f95a23c
TL
21class MMDSFindIno : public SafeMessage {
22 static const int HEAD_VERSION = 1;
23 static const int COMPAT_VERSION = 1;
11fdf7f2 24public:
11fdf7f2 25 ceph_tid_t tid {0};
7c673cae
FG
26 inodeno_t ino;
27
11fdf7f2 28protected:
9f95a23c
TL
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) {}
11fdf7f2 31 ~MMDSFindIno() override {}
7c673cae 32
11fdf7f2
TL
33public:
34 std::string_view get_type_name() const override { return "findino"; }
7c673cae
FG
35 void print(ostream &out) const override {
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 {
11fdf7f2
TL
45 auto p = payload.cbegin();
46 decode(tid, p);
47 decode(ino, p);
7c673cae 48 }
9f95a23c
TL
49private:
50 template<class T, typename... Args>
51 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
7c673cae
FG
52};
53
54#endif