X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fcls%2Frefcount%2Fcls_refcount_client.cc;fp=src%2Fceph%2Fsrc%2Fcls%2Frefcount%2Fcls_refcount_client.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=1c27a80add436189a77ba36c38030fb001a4cc3d;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/cls/refcount/cls_refcount_client.cc b/src/ceph/src/cls/refcount/cls_refcount_client.cc deleted file mode 100644 index 1c27a80..0000000 --- a/src/ceph/src/cls/refcount/cls_refcount_client.cc +++ /dev/null @@ -1,60 +0,0 @@ -#include - -#include "cls/refcount/cls_refcount_client.h" -#include "cls/refcount/cls_refcount_ops.h" -#include "include/rados/librados.hpp" - -using namespace librados; - - -void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref) -{ - bufferlist in; - cls_refcount_get_op call; - call.tag = tag; - call.implicit_ref = implicit_ref; - ::encode(call, in); - op.exec("refcount", "get", in); -} - -void cls_refcount_put(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref) -{ - bufferlist in; - cls_refcount_put_op call; - call.tag = tag; - call.implicit_ref = implicit_ref; - ::encode(call, in); - op.exec("refcount", "put", in); -} - -void cls_refcount_set(librados::ObjectWriteOperation& op, list& refs) -{ - bufferlist in; - cls_refcount_set_op call; - call.refs = refs; - ::encode(call, in); - op.exec("refcount", "set", in); -} - -int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list *refs, bool implicit_ref) -{ - bufferlist in, out; - cls_refcount_read_op call; - call.implicit_ref = implicit_ref; - ::encode(call, in); - int r = io_ctx.exec(oid, "refcount", "read", in, out); - if (r < 0) - return r; - - cls_refcount_read_ret ret; - try { - bufferlist::iterator iter = out.begin(); - ::decode(ret, iter); - } catch (buffer::error& err) { - return -EIO; - } - - *refs = ret.refs; - - return r; -}