Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / messages / MMDSResolveAck.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_MMDSRESOLVEACK_H
16 #define CEPH_MMDSRESOLVEACK_H
17
18 #include "msg/Message.h"
19
20 #include "include/types.h"
21
22
23 class MMDSResolveAck : public Message {
24  public:
25   map<metareqid_t, bufferlist> commit;
26   vector<metareqid_t> abort;
27
28   MMDSResolveAck() : Message(MSG_MDS_RESOLVEACK) {}
29 private:
30   ~MMDSResolveAck() override {}
31
32 public:
33   const char *get_type_name() const override { return "resolve_ack"; }
34   /*void print(ostream& out) const {
35     out << "resolve_ack.size()
36         << "+" << ambiguous_imap.size()
37         << " imports +" << slave_requests.size() << " slave requests)";
38   }
39   */
40   
41   void add_commit(metareqid_t r) {
42     commit[r].clear();
43   }
44   void add_abort(metareqid_t r) {
45     abort.push_back(r);
46   }
47
48   void encode_payload(uint64_t features) override {
49     ::encode(commit, payload);
50     ::encode(abort, payload);
51   }
52   void decode_payload() override {
53     bufferlist::iterator p = payload.begin();
54     ::decode(commit, p);
55     ::decode(abort, p);
56   }
57 };
58
59 #endif