diff options
author | Sage Weil <sage@newdream.net> | 2012-04-26 11:12:11 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-04-26 18:49:19 -0700 |
commit | 873e9beedfe66d5bc218b53964000915dbee370a (patch) | |
tree | 54ea483b27367f71795c86aaae47a90d8a3406ea | |
parent | ed1024fb15729651a987ccf3fe9d1ecf91cae164 (diff) | |
download | ceph-873e9beedfe66d5bc218b53964000915dbee370a.tar.gz |
osdmap: dedup pg_temp
We only deal with the case where the entire map is identical, since the
individual items are too small to make the pointer overhead worthwhile.
Too bad. A in-memory btree-like structure would work better for this.
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r-- | src/osd/OSDMap.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index fd05ce96e21..87edad3b551 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -605,6 +605,12 @@ void OSDMap::dedup(const OSDMap *o, OSDMap *n) if (oc.contents_equal(nc)) { n->crush = o->crush; } + + // does pg_temp match? + if (o->pg_temp->size() == n->pg_temp->size()) { + if (*o->pg_temp == *n->pg_temp) + n->pg_temp = o->pg_temp; + } } int OSDMap::apply_incremental(Incremental &inc) |