From: Samuel Just Date: Mon, 23 Oct 2023 23:45:58 +0000 (-0700) Subject: common/hobject: introduce get_max_object_boundary X-Git-Tag: v19.3.0~296^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f28000550acb4c1f11336905dc30255cb9dfc756;p=ceph.git common/hobject: introduce get_max_object_boundary Scrub doesn't want to split snapshot sets across chunks. The range, however, is exclusive on the right. get_max_object_boundary() gives us a way to always include head and all snapshots in the same chunk as it will sort greater than any legal object with the same head. Signed-off-by: Samuel Just --- diff --git a/src/common/hobject.h b/src/common/hobject.h index 34191ccf5ec8..e35e2b0732f6 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -166,6 +166,7 @@ public: return ret; } + /// @return min hobject_t ret s.t. ret.get_head() == get_head() hobject_t get_object_boundary() const { if (is_max()) return *this; @@ -174,6 +175,15 @@ public: return ret; } + /// @return max hobject_t ret s.t. ret.get_head() == get_head() + hobject_t get_max_object_boundary() const { + if (is_max()) + return *this; + // CEPH_SNAPDIR happens to sort above HEAD and MAX_SNAP and is no longer used + // for actual objects + return get_snapdir(); + } + /// @return head version of this hobject_t hobject_t get_head() const { hobject_t ret(*this);