From: Sage Weil Date: Fri, 23 Sep 2016 15:32:11 +0000 (-0400) Subject: osd/PG: pass last_writen_info to _prepare_write_info X-Git-Tag: v11.1.0~600^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=203a7212984991b88d7011b4c1d104c7462cec1f;p=ceph.git osd/PG: pass last_writen_info to _prepare_write_info We'll use this shortly. Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 44e907a6f096..3d06d90b7d0d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2782,7 +2782,7 @@ void PG::upgrade(ObjectStore *store) int PG::_prepare_write_info(map *km, epoch_t epoch, - pg_info_t &info, + pg_info_t &info, pg_info_t &last_written_info, map &past_intervals, bool dirty_big_info, bool dirty_epoch) @@ -2841,7 +2841,9 @@ void PG::prepare_write_info(map *km) unstable_stats.clear(); bool need_update_epoch = last_epoch < get_osdmap()->get_epoch(); - int ret = _prepare_write_info(km, get_osdmap()->get_epoch(), info, + int ret = _prepare_write_info(km, get_osdmap()->get_epoch(), + info, + last_written_info, past_intervals, dirty_big_info, need_update_epoch); assert(ret == 0); diff --git a/src/osd/PG.h b/src/osd/PG.h index 7a8f85b84d64..8f454fd8434b 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -292,7 +292,8 @@ public: return pool.info.ec_pool(); } // pg state - pg_info_t info; + pg_info_t info; ///< current pg info + pg_info_t last_written_info; ///< last written info __u8 info_struct_v; static const __u8 cur_struct_v = 8; // v7 was SnapMapper addition in 86658392516d5175b2756659ef7ffaaf95b0f8ad @@ -2235,6 +2236,7 @@ public: static int _prepare_write_info(map *km, epoch_t epoch, pg_info_t &info, + pg_info_t &last_written_info, map &past_intervals, bool dirty_big_info, bool dirty_epoch); diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 44f688077379..f3a14d84a213 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -477,9 +477,11 @@ int write_info(ObjectStore::Transaction &t, epoch_t epoch, pg_info_t &info, coll_t coll(info.pgid); ghobject_t pgmeta_oid(info.pgid.make_pgmeta_oid()); map km; + pg_info_t last_written_info; int ret = PG::_prepare_write_info( &km, epoch, info, + last_written_info, past_intervals, true, true); if (ret) cerr << "Failed to write info" << std::endl;