]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MMDSOpenInoReply.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / messages / MMDSOpenInoReply.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_MDSOPENINOREPLY_H
16#define CEPH_MDSOPENINOREPLY_H
17
18#include "msg/Message.h"
19
11fdf7f2
TL
20class MMDSOpenInoReply : public MessageInstance<MMDSOpenInoReply> {
21public:
22 friend factory;
23
7c673cae
FG
24 inodeno_t ino;
25 vector<inode_backpointer_t> ancestors;
26 mds_rank_t hint;
27 int32_t error;
28
11fdf7f2
TL
29protected:
30 MMDSOpenInoReply() : MessageInstance(MSG_MDS_OPENINOREPLY), error(0) {}
7c673cae 31 MMDSOpenInoReply(ceph_tid_t t, inodeno_t i, mds_rank_t h=MDS_RANK_NONE, int e=0) :
11fdf7f2 32 MessageInstance(MSG_MDS_OPENINOREPLY), ino(i), hint(h), error(e) {
7c673cae
FG
33 header.tid = t;
34 }
35
11fdf7f2
TL
36
37public:
38 std::string_view get_type_name() const override { return "openinoreply"; }
7c673cae
FG
39 void print(ostream &out) const override {
40 out << "openinoreply(" << header.tid << " "
41 << ino << " " << hint << " " << ancestors << ")";
42 }
43
44 void encode_payload(uint64_t features) override {
11fdf7f2
TL
45 using ceph::encode;
46 encode(ino, payload);
47 encode(ancestors, payload);
48 encode(hint, payload);
49 encode(error, payload);
7c673cae
FG
50 }
51 void decode_payload() override {
11fdf7f2
TL
52 auto p = payload.cbegin();
53 decode(ino, p);
54 decode(ancestors, p);
55 decode(hint, p);
56 decode(error, p);
7c673cae
FG
57 }
58};
59
60#endif