summaryrefslogtreecommitdiff
path: root/src/osd/osd_types.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/osd_types.cc')
-rw-r--r--src/osd/osd_types.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc
index 74975a91758..5b15afed065 100644
--- a/src/osd/osd_types.cc
+++ b/src/osd/osd_types.cc
@@ -2508,18 +2508,20 @@ void ScrubMap::generate_test_instances(list<ScrubMap*>& o)
void ScrubMap::object::encode(bufferlist& bl) const
{
- ENCODE_START(3, 2, bl);
+ ENCODE_START(4, 2, bl);
::encode(size, bl);
::encode(negative, bl);
::encode(attrs, bl);
::encode(digest, bl);
::encode(digest_present, bl);
+ ::encode(nlinks, bl);
+ ::encode(snapcolls, bl);
ENCODE_FINISH(bl);
}
void ScrubMap::object::decode(bufferlist::iterator& bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(4, 2, 2, bl);
::decode(size, bl);
::decode(negative, bl);
::decode(attrs, bl);
@@ -2531,6 +2533,14 @@ void ScrubMap::object::decode(bufferlist::iterator& bl)
digest = 0;
digest_present = false;
}
+ if (struct_v >= 4) {
+ ::decode(nlinks, bl);
+ ::decode(snapcolls, bl);
+ } else {
+ /* Indicates that encoder was not aware of this field since stat must
+ * return nlink >= 1 */
+ nlinks = 0;
+ }
DECODE_FINISH(bl);
}