Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / cls / refcount / cls_refcount_ops.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_CLS_REFCOUNT_OPS_H
5 #define CEPH_CLS_REFCOUNT_OPS_H
6
7 #include "include/types.h"
8
9 class Formatter;
10
11 struct cls_refcount_get_op {
12   string tag;
13   bool implicit_ref;
14
15   cls_refcount_get_op() : implicit_ref(false) {}
16
17   void encode(bufferlist& bl) const {
18     ENCODE_START(1, 1, bl);
19     ::encode(tag, bl);
20     ::encode(implicit_ref, bl);
21     ENCODE_FINISH(bl);
22   }
23
24   void decode(bufferlist::iterator& bl) {
25     DECODE_START(1, bl);
26     ::decode(tag, bl);
27     ::decode(implicit_ref, bl);
28     DECODE_FINISH(bl);
29   }
30   void dump(ceph::Formatter *f) const;
31   static void generate_test_instances(list<cls_refcount_get_op*>& ls);
32 };
33 WRITE_CLASS_ENCODER(cls_refcount_get_op)
34
35 struct cls_refcount_put_op {
36   string tag;
37   bool implicit_ref; // assume wildcard reference for
38                           // objects without a set ref
39
40   cls_refcount_put_op() : implicit_ref(false) {}
41
42   void encode(bufferlist& bl) const {
43     ENCODE_START(1, 1, bl);
44     ::encode(tag, bl);
45     ::encode(implicit_ref, bl);
46     ENCODE_FINISH(bl);
47   }
48
49   void decode(bufferlist::iterator& bl) {
50     DECODE_START(1, bl);
51     ::decode(tag, bl);
52     ::decode(implicit_ref, bl);
53     DECODE_FINISH(bl);
54   }
55
56   void dump(ceph::Formatter *f) const;
57   static void generate_test_instances(list<cls_refcount_put_op*>& ls);
58 };
59 WRITE_CLASS_ENCODER(cls_refcount_put_op)
60
61 struct cls_refcount_set_op {
62   list<string> refs;
63
64   cls_refcount_set_op() {}
65
66   void encode(bufferlist& bl) const {
67     ENCODE_START(1, 1, bl);
68     ::encode(refs, bl);
69     ENCODE_FINISH(bl);
70   }
71
72   void decode(bufferlist::iterator& bl) {
73     DECODE_START(1, bl);
74     ::decode(refs, bl);
75     DECODE_FINISH(bl);
76   }
77
78   void dump(ceph::Formatter *f) const;
79   static void generate_test_instances(list<cls_refcount_set_op*>& ls);
80 };
81 WRITE_CLASS_ENCODER(cls_refcount_set_op)
82
83 struct cls_refcount_read_op {
84   bool implicit_ref; // assume wildcard reference for
85                           // objects without a set ref
86
87   cls_refcount_read_op() : implicit_ref(false) {}
88
89   void encode(bufferlist& bl) const {
90     ENCODE_START(1, 1, bl);
91     ::encode(implicit_ref, bl);
92     ENCODE_FINISH(bl);
93   }
94
95   void decode(bufferlist::iterator& bl) {
96     DECODE_START(1, bl);
97     ::decode(implicit_ref, bl);
98     DECODE_FINISH(bl);
99   }
100
101   void dump(ceph::Formatter *f) const;
102   static void generate_test_instances(list<cls_refcount_read_op*>& ls);
103 };
104 WRITE_CLASS_ENCODER(cls_refcount_read_op)
105
106 struct cls_refcount_read_ret {
107   list<string> refs;
108
109   cls_refcount_read_ret() {}
110
111   void encode(bufferlist& bl) const {
112     ENCODE_START(1, 1, bl);
113     ::encode(refs, bl);
114     ENCODE_FINISH(bl);
115   }
116
117   void decode(bufferlist::iterator& bl) {
118     DECODE_START(1, bl);
119     ::decode(refs, bl);
120     DECODE_FINISH(bl);
121   }
122
123   void dump(ceph::Formatter *f) const;
124   static void generate_test_instances(list<cls_refcount_read_ret*>& ls);
125 };
126 WRITE_CLASS_ENCODER(cls_refcount_read_ret)
127
128
129 #endif