1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_CLS_CAS_OPS_H
5 #define CEPH_CLS_CAS_OPS_H
7 #include "include/types.h"
8 #include "common/hobject.h"
10 #define CHUNK_REFCOUNT_ATTR "chunk_refcount"
12 struct cls_chunk_refcount_get_op
{
15 cls_chunk_refcount_get_op() {}
17 void encode(bufferlist
& bl
) const {
18 ENCODE_START(1, 1, bl
);
23 void decode(bufferlist::const_iterator
& bl
) {
28 void dump(ceph::Formatter
*f
) const;
29 static void generate_test_instances(list
<cls_chunk_refcount_get_op
*>& ls
);
31 WRITE_CLASS_ENCODER(cls_chunk_refcount_get_op
)
33 struct cls_chunk_refcount_put_op
{
36 cls_chunk_refcount_put_op() {}
38 void encode(bufferlist
& bl
) const {
39 ENCODE_START(1, 1, bl
);
44 void decode(bufferlist::const_iterator
& bl
) {
50 void dump(ceph::Formatter
*f
) const;
51 static void generate_test_instances(list
<cls_chunk_refcount_put_op
*>& ls
);
53 WRITE_CLASS_ENCODER(cls_chunk_refcount_put_op
)
55 struct cls_chunk_refcount_set_op
{
58 cls_chunk_refcount_set_op() {}
60 void encode(bufferlist
& bl
) const {
61 ENCODE_START(1, 1, bl
);
66 void decode(bufferlist::const_iterator
& bl
) {
72 void dump(ceph::Formatter
*f
) const;
73 static void generate_test_instances(list
<cls_chunk_refcount_set_op
*>& ls
);
75 WRITE_CLASS_ENCODER(cls_chunk_refcount_set_op
)
77 struct cls_chunk_refcount_read_ret
{
80 cls_chunk_refcount_read_ret() {}
82 void encode(bufferlist
& bl
) const {
83 ENCODE_START(1, 1, bl
);
88 void decode(bufferlist::const_iterator
& bl
) {
94 void dump(ceph::Formatter
*f
) const;
95 static void generate_test_instances(list
<cls_chunk_refcount_read_ret
*>& ls
);
97 WRITE_CLASS_ENCODER(cls_chunk_refcount_read_ret
)
99 struct chunk_obj_refcount
{
102 chunk_obj_refcount() {}
104 void encode(bufferlist
& bl
) const {
105 ENCODE_START(1, 1, bl
);
110 void decode(bufferlist::const_iterator
& bl
) {
116 WRITE_CLASS_ENCODER(chunk_obj_refcount
)
118 struct obj_refcount
{
119 map
<string
, bool> refs
;
120 set
<string
> retired_refs
;
124 void encode(bufferlist
& bl
) const {
125 ENCODE_START(2, 1, bl
);
127 encode(retired_refs
, bl
);
131 void decode(bufferlist::const_iterator
& bl
) {
135 decode(retired_refs
, bl
);
140 WRITE_CLASS_ENCODER(obj_refcount
)