]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: pass last_writen_info to _prepare_write_info
authorSage Weil <sage@redhat.com>
Fri, 23 Sep 2016 15:32:11 +0000 (11:32 -0400)
committerSage Weil <sage@redhat.com>
Tue, 18 Oct 2016 13:26:30 +0000 (09:26 -0400)
We'll use this shortly.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/tools/ceph_objectstore_tool.cc

index 44e907a6f09636e48d7650550937e9ff03f4c519..3d06d90b7d0d83bc5aa60cfb310aeb6b19308f8a 100644 (file)
@@ -2782,7 +2782,7 @@ void PG::upgrade(ObjectStore *store)
 
 int PG::_prepare_write_info(map<string,bufferlist> *km,
                            epoch_t epoch,
-                           pg_info_t &info,
+                           pg_info_t &info, pg_info_t &last_written_info,
                            map<epoch_t,pg_interval_t> &past_intervals,
                            bool dirty_big_info,
                            bool dirty_epoch)
@@ -2841,7 +2841,9 @@ void PG::prepare_write_info(map<string,bufferlist> *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);
index 7a8f85b84d6456883a185b652c750083338b2ea5..8f454fd8434b5e6c56fe8fe5574cd2c8c90b6a14 100644 (file)
@@ -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<string,bufferlist> *km,
     epoch_t epoch,
     pg_info_t &info,
+    pg_info_t &last_written_info,
     map<epoch_t,pg_interval_t> &past_intervals,
     bool dirty_big_info,
     bool dirty_epoch);
index 44f688077379499119c731c6243b67c060e75cd9..f3a14d84a213a3678d4d8f9a626010944812ef2d 100644 (file)
@@ -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<string,bufferlist> 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;