summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zafman <david.zafman@inktank.com>2013-04-05 21:39:34 -0700
committerDavid Zafman <david.zafman@inktank.com>2013-04-19 17:08:36 -0700
commitda39f911e0fd261038d7d4e5bc2820296a3fca3e (patch)
treef7b45dae4de038674e9af7a8de32a18079e399ba
parent76505c28de2879bf8edf8a454baeae08ddebb538 (diff)
downloadceph-da39f911e0fd261038d7d4e5bc2820296a3fca3e.tar.gz
osd: Create static PG::_write_log() function
Signed-off-by: David Zafman <david.zafman@inktank.com>
-rw-r--r--src/osd/PG.cc13
-rw-r--r--src/osd/PG.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index 78c05246ea9..cebeaa4b577 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -2579,9 +2579,10 @@ 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)
+void PG::_write_log(ObjectStore::Transaction& t, pg_log_t &log,
+ const hobject_t &log_oid, map<eversion_t, hobject_t> &divergent_priors)
{
- dout(10) << "write_log" << dendl;
+ //dout(10) << "write_log" << dendl;
t.remove(coll_t::META_COLL, log_oid);
t.touch(coll_t::META_COLL, log_oid);
map<string,bufferlist> keys;
@@ -2592,12 +2593,16 @@ void PG::write_log(ObjectStore::Transaction& t)
p->encode_with_checksum(bl);
keys[p->get_key_name()].claim(bl);
}
- dout(10) << "write_log " << keys.size() << " keys" << dendl;
+ //dout(10) << "write_log " << keys.size() << " keys" << dendl;
- ::encode(ondisklog.divergent_priors, keys["divergent_priors"]);
+ ::encode(divergent_priors, keys["divergent_priors"]);
t.omap_setkeys(coll_t::META_COLL, log_oid, keys);
+}
+void PG::write_log(ObjectStore::Transaction& t)
+{
+ _write_log(t, log, log_oid, ondisklog.divergent_priors);
dirty_log = false;
}
diff --git a/src/osd/PG.h b/src/osd/PG.h
index 5ab9caa2ebe..d4bdbc8e4cf 100644
--- a/src/osd/PG.h
+++ b/src/osd/PG.h
@@ -1837,6 +1837,8 @@ public:
interval_set<snapid_t> &snap_collections,
hobject_t &infos_oid,
__u8 info_struct_v, bool dirty_big_info);
+ static void _write_log(ObjectStore::Transaction& t, pg_log_t &log,
+ const hobject_t &log_oid, map<eversion_t, hobject_t> &divergent_priors);
void write_if_dirty(ObjectStore::Transaction& t);
void add_log_entry(pg_log_entry_t& e, bufferlist& log_bl);