From: Greg Farnum Date: Fri, 20 Dec 2013 23:26:11 +0000 (-0800) Subject: OSDMap: add primary-specifying pg_to_acting_osds X-Git-Tag: v0.77~9^2~107^2~16 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=045e1d75a705b377ae551040b88b8f9eddfecc69;p=ceph.git OSDMap: add primary-specifying pg_to_acting_osds This works the same as pg_to_up_acting_osds Signed-off-by: Greg Farnum --- diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 7bde573dde1fc..7bdd8e006af03 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -519,9 +519,17 @@ public: */ int pg_to_osds(pg_t pg, vector *raw, int *primary) const; /// map a pg to its acting set. @return acting set size + int pg_to_acting_osds(pg_t pg, vector *acting, + int *acting_primary) const { + _pg_to_up_acting_osds(pg, NULL, *acting); + *acting_primary = (acting->empty() ? -1 : acting->front()); + return acting->size(); + } int pg_to_acting_osds(pg_t pg, vector& acting) const { - _pg_to_up_acting_osds(pg, NULL, acting); - return acting.size(); + int primary; + int r = pg_to_acting_osds(pg, &acting, &primary); + assert(acting.empty() || primary == acting.front()); + return r; } /** * This does not apply temp overrides and should not be used