]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MExportDirAck.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / messages / MExportDirAck.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) 2004-2006 Sage Weil <sage@newdream.net>
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_MEXPORTDIRACK_H
16 #define CEPH_MEXPORTDIRACK_H
17
18 #include "MExportDir.h"
19 #include "msg/Message.h"
20
21 class MExportDirAck : public MessageInstance<MExportDirAck> {
22 public:
23 friend factory;
24
25 dirfrag_t dirfrag;
26 bufferlist imported_caps;
27
28 dirfrag_t get_dirfrag() const { return dirfrag; }
29
30 protected:
31 MExportDirAck() : MessageInstance(MSG_MDS_EXPORTDIRACK) {}
32 MExportDirAck(dirfrag_t df, uint64_t tid) :
33 MessageInstance(MSG_MDS_EXPORTDIRACK), dirfrag(df) {
34 set_tid(tid);
35 }
36 ~MExportDirAck() override {}
37
38 public:
39 std::string_view get_type_name() const override { return "ExAck"; }
40 void print(ostream& o) const override {
41 o << "export_ack(" << dirfrag << ")";
42 }
43
44 void decode_payload() override {
45 auto p = payload.cbegin();
46 decode(dirfrag, p);
47 decode(imported_caps, p);
48 }
49 void encode_payload(uint64_t features) override {
50 using ceph::encode;
51 encode(dirfrag, payload);
52 encode(imported_caps, payload);
53 }
54
55 };
56
57 #endif