Skip to content

Instantly share code, notes, and snippets.

@cbodley
Created September 2, 2020 18:21
Show Gist options
  • Select an option

  • Save cbodley/b6ccd16cda693cdb23864cfb334f90b0 to your computer and use it in GitHub Desktop.

Select an option

Save cbodley/b6ccd16cda693cdb23864cfb334f90b0 to your computer and use it in GitHub Desktop.
void encode(ceph::buffer::list& bl) const {
- ENCODE_START(1, 1, bl);
+ ENCODE_START(2, 1, bl);
encode((uint8_t)reshard_status, bl);
- encode(new_bucket_instance_id, bl);
- encode(num_shards, bl);
ENCODE_FINISH(bl);
}
void decode(ceph::buffer::list::const_iterator& bl) {
- DECODE_START(1, bl);
+ DECODE_START(2, bl);
uint8_t s;
decode(s, bl);
reshard_status = (cls_rgw_reshard_status)s;
- decode(new_bucket_instance_id, bl);
- decode(num_shards, bl);
+ if (struct_v < 2) { // decode fields removed from version 1
+ std::string new_bucket_instance_id;
+ decode(new_bucket_instance_id, bl);
+ int32_t num_shards;
+ decode(num_shards, bl);
+ }
DECODE_FINISH(bl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment