summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-01-09 11:56:16 -0800
committerSage Weil <sage@inktank.com>2013-01-15 19:21:15 -0800
commitf969f6b39727a2135e39729d61960d8efda2be39 (patch)
tree446ee6787a94b525f1a76af42b5037e77184791a
parentb6561a2f92b13bb1ddcd9b78e442d1548d6e3bef (diff)
downloadceph-f969f6b39727a2135e39729d61960d8efda2be39.tar.gz
osd_types: bring ScrubMap::object up to the 0.56.1 encoding
We need to introduce some new fields here, so to maintain compatibility we'll need to first bring the 48.* series up to the current encoding. Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/osd_types.cc14
-rw-r--r--src/osd/osd_types.h4
2 files changed, 15 insertions, 3 deletions
diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc
index c939270f718..74975a91758 100644
--- a/src/osd/osd_types.cc
+++ b/src/osd/osd_types.cc
@@ -2508,19 +2508,29 @@ void ScrubMap::generate_test_instances(list<ScrubMap*>& o)
void ScrubMap::object::encode(bufferlist& bl) const
{
- ENCODE_START(2, 2, bl);
+ ENCODE_START(3, 2, bl);
::encode(size, bl);
::encode(negative, bl);
::encode(attrs, bl);
+ ::encode(digest, bl);
+ ::encode(digest_present, bl);
ENCODE_FINISH(bl);
}
void ScrubMap::object::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
::decode(size, bl);
::decode(negative, bl);
::decode(attrs, bl);
+ if (struct_v >= 3) {
+ ::decode(digest, bl);
+ ::decode(digest_present, bl);
+ }
+ else {
+ digest = 0;
+ digest_present = false;
+ }
DECODE_FINISH(bl);
}
diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h
index e2ca0e04515..b2a41a175a7 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -1749,8 +1749,10 @@ struct ScrubMap {
uint64_t size;
bool negative;
map<string,bufferptr> attrs;
+ __u32 digest;
+ bool digest_present;
- object(): size(0), negative(false) {}
+ object(): size(0), negative(false), digest(0), digest_present(false) {}
void encode(bufferlist& bl) const;
void decode(bufferlist::iterator& bl);