From 7eb287308c5f19be5e130e3d3511eaca8242eed4 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 20 Dec 2011 16:52:38 -0800 Subject: [PATCH] PG: add some documentation Signed-off-by: Samuel Just --- src/osd/PG.cc | 8 ++++++++ src/osd/PG.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 33599002d7641..ebb5dfb109f70 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -880,6 +880,14 @@ void PG::clear_primary_state() osd->snap_trim_wq.dequeue(this); } +/** + * find_best_info + * + * Returns an iterator to the best info in infos sorted by: + * 1) Prefer newer last_update + * 2) Prefer longer tail if it brings another info into contiguity + * 3) Prefer current primary + */ map::const_iterator PG::find_best_info(const map &infos) const { map::const_iterator best = infos.end(); diff --git a/src/osd/PG.h b/src/osd/PG.h index 703217106009a..39bf1d91ad881 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1388,6 +1388,15 @@ protected: epoch_t last_peering_reset; + /** + * BackfillInterval + * + * Represents the objects in a range [begin, end) + * + * Possible states: + * 1) begin == end == hobject_t() indicates the the interval is unpopulated + * 2) Else, objects contains all objects in [begin, end) + */ struct BackfillInterval { // info about a backfill interval on a peer map objects; -- 2.39.5