return (size + ROUND_BLOCK_SIZE - 1) & ~(ROUND_BLOCK_SIZE - 1);
}
+/*
+ * This takes a string that either wholly contains a delimiter or is a
+ * path that ends with a delimiter and appends a new character to the
+ * end such that when a we request bucket-index entries *after* this,
+ * we'll get the next object after the "subdirectory". This works
+ * because we append a '\xFF' charater, and no valid UTF-8 character
+ * can contain that byte, so no valid entries can be skipped.
+ */
+static inline std::string cls_rgw_after_delim(const std::string& path) {
+ // assert: ! path.empty()
+ return path + '\xFF';
+}
+
struct rgw_bucket_pending_info {
RGWPendingState state;
ceph::real_time timestamp;
}
-static inline std::string after_delim(std::string_view delim)
-{
- // assert: ! delim.empty()
- std::string result{delim.data(), delim.length()};
- result += char(255);
- return result;
-}
-
-
/**
* Get ordered listing of the objects in a bucket.
*
string after_delim_s; /* needed in !params.delim.empty() AND later */
if (!params.delim.empty()) {
- after_delim_s = after_delim(params.delim);
+ after_delim_s = cls_rgw_after_delim(params.delim);
/* if marker points at a common prefix, fast forward it into its
* upper bound string */
int delim_pos = cur_marker.name.find(params.delim, cur_prefix.size());