diff options
author | David Zafman <david.zafman@inktank.com> | 2013-04-15 23:40:13 -0700 |
---|---|---|
committer | David Zafman <david.zafman@inktank.com> | 2013-04-19 17:08:37 -0700 |
commit | 460db089554e254426d45c096390dfc69e1f2bc4 (patch) | |
tree | 5a2aff444ba760a5b341fff746e2ad178daaf2d8 | |
parent | da39f911e0fd261038d7d4e5bc2820296a3fca3e (diff) | |
download | ceph-460db089554e254426d45c096390dfc69e1f2bc4.tar.gz |
osd: Add flag to force version write in _write_info()
Signed-off-by: David Zafman <david.zafman@inktank.com>
-rw-r--r-- | src/osd/PG.cc | 4 | ||||
-rw-r--r-- | src/osd/PG.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc index cebeaa4b577..18af764641b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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); diff --git a/src/osd/PG.h b/src/osd/PG.h index d4bdbc8e4cf..813d1c5b212 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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); |