]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MExportDirNotifyAck.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / messages / MExportDirNotifyAck.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_MEXPORTDIRNOTIFYACK_H
16 #define CEPH_MEXPORTDIRNOTIFYACK_H
17
18 #include "messages/MMDSOp.h"
19
20 class MExportDirNotifyAck final : public MMDSOp {
21 private:
22 static constexpr int HEAD_VERSION = 1;
23 static constexpr int COMPAT_VERSION = 1;
24
25 dirfrag_t dirfrag;
26 std::pair<__s32,__s32> new_auth;
27
28 public:
29 dirfrag_t get_dirfrag() const { return dirfrag; }
30 std::pair<__s32,__s32> get_new_auth() const { return new_auth; }
31
32 protected:
33 MExportDirNotifyAck() :
34 MMDSOp{MSG_MDS_EXPORTDIRNOTIFYACK, HEAD_VERSION, COMPAT_VERSION} {}
35 MExportDirNotifyAck(dirfrag_t df, uint64_t tid, std::pair<__s32,__s32> na) :
36 MMDSOp{MSG_MDS_EXPORTDIRNOTIFYACK, HEAD_VERSION, COMPAT_VERSION}, dirfrag(df), new_auth(na) {
37 set_tid(tid);
38 }
39 ~MExportDirNotifyAck() final {}
40
41 public:
42 std::string_view get_type_name() const override { return "ExNotA"; }
43 void print(std::ostream& o) const override {
44 o << "export_notify_ack(" << dirfrag << ")";
45 }
46
47 void encode_payload(uint64_t features) override {
48 using ceph::encode;
49 encode(dirfrag, payload);
50 encode(new_auth, payload);
51 }
52 void decode_payload() override {
53 using ceph::decode;
54 auto p = payload.cbegin();
55 decode(dirfrag, p);
56 decode(new_auth, p);
57 }
58 private:
59 template<class T, typename... Args>
60 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
61 template<class T, typename... Args>
62 friend MURef<T> crimson::make_message(Args&&... args);
63 };
64
65 #endif