]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/cls/rgw/cls_rgw_client.h
update sources to v12.2.3
[ceph.git] / ceph / src / cls / rgw / cls_rgw_client.h
index 3a49c2dbbefd6b6e36d365febc892ee4eb144706..c4ab0f648a5c2ac922142a2de2c8a9c522ec3f2a 100644 (file)
@@ -4,6 +4,7 @@
 #include "include/str_list.h"
 #include "include/rados/librados.hpp"
 #include "cls_rgw_ops.h"
+#include "cls_rgw_const.h"
 #include "common/RefCountedObj.h"
 #include "include/compat.h"
 #include "common/ceph_time.h"
@@ -217,6 +218,15 @@ public:
     }
     return 0;
   }
+
+  // trim the '<shard-id>#' prefix from a single shard marker if present
+  static std::string get_shard_marker(const std::string& marker) {
+    auto p = marker.find(KEY_VALUE_SEPARATOR);
+    if (p == marker.npos) {
+      return marker;
+    }
+    return marker.substr(p + 1);
+  }
 };
 
 /* bucket index */
@@ -493,7 +503,7 @@ int cls_rgw_usage_log_read(librados::IoCtx& io_ctx, string& oid, string& user,
                            string& read_iter, map<rgw_user_bucket, rgw_usage_log_entry>& usage,
                            bool *is_truncated);
 
-void cls_rgw_usage_log_trim(librados::ObjectWriteOperation& op, string& user,
+int cls_rgw_usage_log_trim(librados::IoCtx& io_ctx, const string& oid, string& user,
                            uint64_t start_epoch, uint64_t end_epoch);
 
 void cls_rgw_usage_log_add(librados::ObjectWriteOperation& op, rgw_usage_log_info& info);