encode_json("source", source, f);
encode_json("dest", dest, f);
encode_json("priority", priority, f);
+ string s;
+ switch (mode) {
+ case MODE_SYSTEM:
+ s = "system";
+ break;
+ default:
+ s = "user";
+ }
+ encode_json("mode", s, f);
}
void rgw_sync_pipe_params::decode_json(JSONObj *obj)
JSONDecoder::decode_json("source", source, obj);
JSONDecoder::decode_json("dest", dest, obj);
JSONDecoder::decode_json("priority", priority, obj);
+ string s;
+ JSONDecoder::decode_json("mode", s, obj);
+ if (s == "system") {
+ mode = MODE_SYSTEM;
+ } else {
+ mode = MODE_USER;
+ }
}
struct rgw_sync_pipe_params {
rgw_sync_pipe_source_params source;
rgw_sync_pipe_dest_params dest;
+ enum Mode {
+ MODE_SYSTEM = 0,
+ MODE_USER = 1,
+ } mode{MODE_SYSTEM};
int32_t priority{0};
void encode(bufferlist& bl) const {
encode(source, bl);
encode(dest, bl);
encode(priority, bl);
+ encode((uint8_t)mode, bl);
ENCODE_FINISH(bl);
}
decode(source, bl);
decode(dest, bl);
decode(priority, bl);
+ uint8_t m;
+ decode(m, bl);
+ mode = (Mode)m;
DECODE_FINISH(bl);
}