3 #include "cls/refcount/cls_refcount_client.h"
4 #include "cls/refcount/cls_refcount_ops.h"
5 #include "include/rados/librados.hpp"
7 using namespace librados;
10 void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref)
13 cls_refcount_get_op call;
15 call.implicit_ref = implicit_ref;
17 op.exec("refcount", "get", in);
20 void cls_refcount_put(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref)
23 cls_refcount_put_op call;
25 call.implicit_ref = implicit_ref;
27 op.exec("refcount", "put", in);
30 void cls_refcount_set(librados::ObjectWriteOperation& op, list<string>& refs)
33 cls_refcount_set_op call;
36 op.exec("refcount", "set", in);
39 int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs, bool implicit_ref)
42 cls_refcount_read_op call;
43 call.implicit_ref = implicit_ref;
45 int r = io_ctx.exec(oid, "refcount", "read", in, out);
49 cls_refcount_read_ret ret;
51 bufferlist::iterator iter = out.begin();
53 } catch (buffer::error& err) {