diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/rgw/rgw_gc_log.cc | |
parent | Initial commit. (diff) | |
download | ceph-upstream/16.2.11+ds.tar.xz ceph-upstream/16.2.11+ds.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rgw/rgw_gc_log.cc')
-rw-r--r-- | src/rgw/rgw_gc_log.cc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/rgw/rgw_gc_log.cc b/src/rgw/rgw_gc_log.cc new file mode 100644 index 000000000..ad819eddc --- /dev/null +++ b/src/rgw/rgw_gc_log.cc @@ -0,0 +1,55 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab ft=cpp + +#include "rgw_gc_log.h" + +#include "cls/rgw/cls_rgw_client.h" +#include "cls/rgw_gc/cls_rgw_gc_client.h" +#include "cls/version/cls_version_client.h" + + +void gc_log_init2(librados::ObjectWriteOperation& op, + uint64_t max_size, uint64_t max_deferred) +{ + obj_version objv; // objv.ver = 0 + cls_version_check(op, objv, VER_COND_EQ); + cls_rgw_gc_queue_init(op, max_size, max_deferred); + objv.ver = 1; + cls_version_set(op, objv); +} + +void gc_log_enqueue1(librados::ObjectWriteOperation& op, + uint32_t expiration, cls_rgw_gc_obj_info& info) +{ + obj_version objv; // objv.ver = 0 + cls_version_check(op, objv, VER_COND_EQ); + cls_rgw_gc_set_entry(op, expiration, info); +} + +void gc_log_enqueue2(librados::ObjectWriteOperation& op, + uint32_t expiration, const cls_rgw_gc_obj_info& info) +{ + obj_version objv; + objv.ver = 1; + cls_version_check(op, objv, VER_COND_EQ); + cls_rgw_gc_queue_enqueue(op, expiration, info); +} + +void gc_log_defer1(librados::ObjectWriteOperation& op, + uint32_t expiration, const cls_rgw_gc_obj_info& info) +{ + obj_version objv; // objv.ver = 0 + cls_version_check(op, objv, VER_COND_EQ); + cls_rgw_gc_defer_entry(op, expiration, info.tag); +} + +void gc_log_defer2(librados::ObjectWriteOperation& op, + uint32_t expiration, const cls_rgw_gc_obj_info& info) +{ + obj_version objv; + objv.ver = 1; + cls_version_check(op, objv, VER_COND_EQ); + cls_rgw_gc_queue_defer_entry(op, expiration, info); + // TODO: conditional on whether omap is known to be empty + cls_rgw_gc_remove(op, {info.tag}); +} |