]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG,PGLog: remove dirty_log arguments
authorSamuel Just <sam.just@inktank.com>
Mon, 10 Jun 2013 23:30:13 +0000 (16:30 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 17 Jun 2013 21:50:53 +0000 (14:50 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/PGLog.cc
src/osd/PGLog.h

index 6742320b7490e049b63895a91a43299a7298b964..d1ebef0642322ca51da375bc4954b269dbbab507 100644 (file)
@@ -152,7 +152,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   #ifdef PG_DEBUG_REFS
   _ref_id_lock("PG::_ref_id_lock"), _ref_id(0),
   #endif
-  deleting(false), dirty_info(false), dirty_big_info(false), dirty_log(false),
+  deleting(false), dirty_info(false), dirty_big_info(false),
   info(p),
   info_struct_v(0),
   coll(p), log_oid(loid), biginfo_oid(ioid),
@@ -196,7 +196,6 @@ void PG::lock(bool no_lockdep)
   // if we have unrecorded dirty state with the lock dropped, there is a bug
   assert(!dirty_info);
   assert(!dirty_big_info);
-  assert(!dirty_log);
 
   dout(30) << "lock" << dendl;
 }
@@ -312,7 +311,7 @@ void PG::remove_snap_mapped_object(
 void PG::merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog, int from)
 {
   list<hobject_t> to_remove;
-  pg_log.merge_log(t, oinfo, olog, from, info, to_remove, dirty_log, dirty_info, dirty_big_info);
+  pg_log.merge_log(t, oinfo, olog, from, info, to_remove, dirty_info, dirty_big_info);
   for(list<hobject_t>::iterator i = to_remove.begin();
       i != to_remove.end();
       ++i)
@@ -322,7 +321,7 @@ void PG::merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog
 void PG::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead)
 {
   list<hobject_t> to_remove;
-  pg_log.rewind_divergent_log(t, newhead, info, to_remove, dirty_log, dirty_info, dirty_big_info);
+  pg_log.rewind_divergent_log(t, newhead, info, to_remove, dirty_info, dirty_big_info);
   for(list<hobject_t>::iterator i = to_remove.begin();
       i != to_remove.end();
       ++i)
@@ -2242,17 +2241,11 @@ epoch_t PG::peek_map_epoch(ObjectStore *store, coll_t coll, hobject_t &infos_oid
   return cur_epoch;
 }
 
-void PG::write_log(ObjectStore::Transaction& t)
-{
-  pg_log.write_log(t, log_oid);
-}
-
 void PG::write_if_dirty(ObjectStore::Transaction& t)
 {
   if (dirty_big_info || dirty_info)
     write_info(t);
-  if (dirty_log)
-    write_log(t);
+  pg_log.write_log(t, log_oid);
 }
 
 void PG::trim_peers()
index 107f76bd4d28eb8e543a1a79ad223e304c781988..c4e113bb9e8d74814b66e4847e8269656b205fc4 100644 (file)
@@ -222,7 +222,6 @@ public:
     //generic_dout(0) << this << " " << info.pgid << " unlock" << dendl;
     assert(!dirty_info);
     assert(!dirty_big_info);
-    assert(!dirty_log);
     _lock.Unlock();
   }
 
@@ -249,7 +248,7 @@ public:
   void get(const string &tag);
   void put(const string &tag);
 
-  bool dirty_info, dirty_big_info, dirty_log;
+  bool dirty_info, dirty_big_info;
 
 public:
   // pg state
@@ -1661,7 +1660,6 @@ public:
 
 private:
   void write_info(ObjectStore::Transaction& t);
-  void write_log(ObjectStore::Transaction& t);
 
 public:
   static int _write_info(ObjectStore::Transaction& t, epoch_t epoch,
index c174221013a6517fab86dd447ee0b565ee39fa1c..5afa5c0aa47f615929c819b43b84ac24957921a9 100644 (file)
@@ -264,7 +264,7 @@ void PGLog::proc_replica_log(ObjectStore::Transaction& t,
  *
  * return true if entry is not divergent.
  */
-bool PGLog::merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe, const pg_info_t& info, list<hobject_t>& remove_snap, bool &dirty_log)
+bool PGLog::merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe, const pg_info_t& info, list<hobject_t>& remove_snap)
 {
   if (oe.soid > info.last_backfill) {
     dout(20) << "merge_old_entry  had " << oe << " : beyond last_backfill" << dendl;
@@ -348,7 +348,7 @@ bool PGLog::merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& o
  */
 void PGLog::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead,
                       pg_info_t &info, list<hobject_t>& remove_snap,
-                      bool &dirty_log, bool &dirty_info, bool &dirty_big_info)
+                      bool &dirty_info, bool &dirty_big_info)
 {
   dout(10) << "rewind_divergent_log truncate divergent future " << newhead << dendl;
   assert(newhead > log.tail);
@@ -379,7 +379,7 @@ void PGLog::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead
     info.last_complete = newhead;
 
   for (list<pg_log_entry_t>::iterator d = divergent.begin(); d != divergent.end(); ++d)
-    merge_old_entry(t, *d, info, remove_snap, dirty_log);
+    merge_old_entry(t, *d, info, remove_snap);
 
   dirty_info = true;
   dirty_big_info = true;
@@ -388,7 +388,7 @@ void PGLog::rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead
 void PGLog::merge_log(ObjectStore::Transaction& t,
                       pg_info_t &oinfo, pg_log_t &olog, int fromosd,
                       pg_info_t &info, list<hobject_t>& remove_snap,
-                      bool &dirty_log, bool &dirty_info, bool &dirty_big_info)
+                      bool &dirty_info, bool &dirty_big_info)
 {
   dout(10) << "merge_log " << olog << " from osd." << fromosd
            << " into " << log << dendl;
@@ -443,7 +443,7 @@ void PGLog::merge_log(ObjectStore::Transaction& t,
 
   // do we have divergent entries to throw out?
   if (olog.head < log.head) {
-    rewind_divergent_log(t, olog.head, info, remove_snap, dirty_log, dirty_info, dirty_big_info);
+    rewind_divergent_log(t, olog.head, info, remove_snap, dirty_info, dirty_big_info);
     changed = true;
   }
 
@@ -512,7 +512,7 @@ void PGLog::merge_log(ObjectStore::Transaction& t,
     // process divergent items
     if (!divergent.empty()) {
       for (list<pg_log_entry_t>::iterator d = divergent.begin(); d != divergent.end(); ++d)
-       merge_old_entry(t, *d, info, remove_snap, dirty_log);
+       merge_old_entry(t, *d, info, remove_snap);
     }
 
     changed = true;
index 7dd16743e5b57c8c2692a7ce9fb867b80dca54ca..8f48278041fda8ab77cf332988f1a026cbccf541 100644 (file)
@@ -313,15 +313,15 @@ public:
 
 protected:
   bool merge_old_entry(ObjectStore::Transaction& t, const pg_log_entry_t& oe,
-                      const pg_info_t& info, list<hobject_t>& remove_snap, bool &dirty_log);
+                      const pg_info_t& info, list<hobject_t>& remove_snap);
 public:
   void rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead,
                             pg_info_t &info, list<hobject_t>& remove_snap,
-                            bool &dirty_log, bool &dirty_info, bool &dirty_big_info);
+                            bool &dirty_info, bool &dirty_big_info);
 
   void merge_log(ObjectStore::Transaction& t, pg_info_t &oinfo, pg_log_t &olog, int from,
                       pg_info_t &info, list<hobject_t>& remove_snap,
-                      bool &dirty_log, bool &dirty_info, bool &dirty_big_info);
+                      bool &dirty_info, bool &dirty_big_info);
 
   void write_log(ObjectStore::Transaction& t, const hobject_t &log_oid);