string cluster_snapshot;
- void encode_client_old(bufferlist& bl) {
+ void encode_client_old(bufferlist& bl) const {
__u16 v = 5;
::encode(v, bl);
::encode(fsid, bl);
// for ::encode(new_pools, bl);
__u32 n = new_pools.size();
::encode(n, bl);
- for (map<int64_t,pg_pool_t>::iterator p = new_pools.begin();
+ for (map<int64_t,pg_pool_t>::const_iterator p = new_pools.begin();
p != new_pools.end();
++p) {
n = p->first;
// for ::encode(new_pool_names, bl);
n = new_pool_names.size();
::encode(n, bl);
- for (map<int64_t, string>::iterator p = new_pool_names.begin(); p != new_pool_names.end(); ++p) {
+ for (map<int64_t, string>::const_iterator p = new_pool_names.begin(); p != new_pool_names.end(); ++p) {
n = p->first;
::encode(n, bl);
::encode(p->second, bl);
// for ::encode(new_pg_temp, bl);
n = new_pg_temp.size();
::encode(n, bl);
- for (map<pg_t,vector<int32_t> >::iterator p = new_pg_temp.begin();
+ for (map<pg_t,vector<int32_t> >::const_iterator p = new_pg_temp.begin();
p != new_pg_temp.end();
++p) {
old_pg_t opg = p->first.get_old_pg();
}
}
- void encode(bufferlist& bl) {
+ void encode(bufferlist& bl, uint64_t features=-1) const {
+ if ((features & CEPH_FEATURE_PGID64) == 0) {
+ encode_client_old(bl);
+ return;
+ }
+
// base
__u16 v = 6;
::encode(v, bl);
}
// serialize, unserialize
- void encode_client_old(bufferlist& bl) {
+ void encode_client_old(bufferlist& bl) const {
__u16 v = 5;
::encode(v, bl);
// for ::encode(pools, bl);
__u32 n = pools.size();
::encode(n, bl);
- for (map<int64_t,pg_pool_t>::iterator p = pools.begin();
+ for (map<int64_t,pg_pool_t>::const_iterator p = pools.begin();
p != pools.end();
++p) {
n = p->first;
// for ::encode(pool_name, bl);
n = pool_name.size();
::encode(n, bl);
- for (map<int64_t, string>::iterator p = pool_name.begin();
+ for (map<int64_t, string>::const_iterator p = pool_name.begin();
p != pool_name.end();
++p) {
n = p->first;
// for ::encode(pg_temp, bl);
n = pg_temp.size();
::encode(n, bl);
- for (map<pg_t,vector<int32_t> >::iterator p = pg_temp.begin();
+ for (map<pg_t,vector<int32_t> >::const_iterator p = pg_temp.begin();
p != pg_temp.end();
++p) {
old_pg_t opg = p->first.get_old_pg();
::encode(cbl, bl);
}
- void encode(bufferlist& bl) {
+ void encode(bufferlist& bl, uint64_t features=-1) const {
+ if ((features & CEPH_FEATURE_PGID64) == 0) {
+ encode_client_old(bl);
+ return;
+ }
+
__u16 v = 6;
::encode(v, bl);