]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Add flag to force version write in _write_info()
authorDavid Zafman <david.zafman@inktank.com>
Tue, 16 Apr 2013 06:40:13 +0000 (23:40 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Sat, 20 Apr 2013 00:08:37 +0000 (17:08 -0700)
Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index cebeaa4b577e085bba4b9ee1e3fc21ed137849c0..18af764641b4311845b323f22f50e9051abc330d 100644 (file)
@@ -2498,7 +2498,7 @@ int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch,
     map<epoch_t,pg_interval_t> &past_intervals,
     interval_set<snapid_t> &snap_collections,
     hobject_t &infos_oid,
-    __u8 info_struct_v, bool dirty_big_info)
+    __u8 info_struct_v, bool dirty_big_info, bool force_ver)
 {
   // pg state
 
@@ -2506,7 +2506,7 @@ int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch,
     return -EINVAL;
 
   // Only need to write struct_v to attr when upgrading
-  if (info_struct_v < cur_struct_v) {
+  if (force_ver || info_struct_v < cur_struct_v) {
     bufferlist attrbl;
     info_struct_v = cur_struct_v;
     ::encode(info_struct_v, attrbl);
index d4bdbc8e4cfa82a2993c45cf28628d5f0ff543ff..813d1c5b212b48b47d4c7251ce39369da7198584 100644 (file)
@@ -1836,7 +1836,7 @@ public:
     map<epoch_t,pg_interval_t> &past_intervals,
     interval_set<snapid_t> &snap_collections,
     hobject_t &infos_oid,
-    __u8 info_struct_v, bool dirty_big_info);
+    __u8 info_struct_v, bool dirty_big_info, bool force_ver = false);
   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);