mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
osd_types: add nlink and snapcolls fields to ScrubMap::object
Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
parent
39bc65492a
commit
b85687475f
@ -2756,18 +2756,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);
|
||||
@ -2779,6 +2781,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);
|
||||
}
|
||||
|
||||
|
@ -1828,8 +1828,12 @@ struct ScrubMap {
|
||||
map<string,bufferptr> attrs;
|
||||
__u32 digest;
|
||||
bool digest_present;
|
||||
uint32_t nlinks;
|
||||
set<snapid_t> snapcolls;
|
||||
|
||||
object(): size(0), negative(false), digest(0), digest_present(false) {}
|
||||
object() :
|
||||
size(0), negative(false), digest(0), digest_present(false),
|
||||
nlinks(0) {}
|
||||
|
||||
void encode(bufferlist& bl) const;
|
||||
void decode(bufferlist::iterator& bl);
|
||||
|
Loading…
Reference in New Issue
Block a user