Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / messages / MExportDirFinish.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_MEXPORTDIRFINISH_H
16 #define CEPH_MEXPORTDIRFINISH_H
17
18 #include "msg/Message.h"
19
20 class MExportDirFinish : public Message {
21   dirfrag_t dirfrag;
22   bool last;
23
24  public:
25   dirfrag_t get_dirfrag() { return dirfrag; }
26   bool is_last() { return last; }
27   
28   MExportDirFinish() : last(false) {}
29   MExportDirFinish(dirfrag_t df, bool l, uint64_t tid) :
30     Message(MSG_MDS_EXPORTDIRFINISH), dirfrag(df), last(l) {
31     set_tid(tid);
32   }
33 private:
34   ~MExportDirFinish() override {}
35
36 public:
37   const char *get_type_name() const override { return "ExFin"; }
38   void print(ostream& o) const override {
39     o << "export_finish(" << dirfrag << (last ? " last" : "") << ")";
40   }
41   
42   void encode_payload(uint64_t features) override {
43     ::encode(dirfrag, payload);
44     ::encode(last, payload);
45   }
46   void decode_payload() override {
47     bufferlist::iterator p = payload.begin();
48     ::decode(dirfrag, p);
49     ::decode(last, p);
50   }
51
52 };
53
54 #endif