Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / librbd / watcher / Types.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "librbd/watcher/Types.h"
5 #include "common/Formatter.h"
6
7 namespace librbd {
8 namespace watcher {
9
10 void ClientId::encode(bufferlist &bl) const {
11   ::encode(gid, bl);
12   ::encode(handle, bl);
13 }
14
15 void ClientId::decode(bufferlist::iterator &iter) {
16   ::decode(gid, iter);
17   ::decode(handle, iter);
18 }
19
20 void ClientId::dump(Formatter *f) const {
21   f->dump_unsigned("gid", gid);
22   f->dump_unsigned("handle", handle);
23 }
24
25 WRITE_CLASS_ENCODER(ClientId);
26
27 void NotifyResponse::encode(bufferlist& bl) const {
28   ::encode(acks, bl);
29   ::encode(timeouts, bl);
30 }
31
32 void NotifyResponse::decode(bufferlist::iterator& iter) {
33   ::decode(acks, iter);
34   ::decode(timeouts, iter);
35 }
36
37 } // namespace watcher
38 } // namespace librbd
39
40 std::ostream &operator<<(std::ostream &out,
41                          const librbd::watcher::ClientId &client_id) {
42   out << "[" << client_id.gid << "," << client_id.handle << "]";
43   return out;
44 }