From 065fa7c50d02cfc2852d19d2fdc0e4d9f6683956 Mon Sep 17 00:00:00 2001 From: Orit Wasserman Date: Sat, 13 Jun 2015 01:29:12 +0200 Subject: [PATCH] rgw: Add RGWNameToId and RGWDefaultSystemMetaObjInfo Signed-off-by: Orit Wasserman --- src/rgw/rgw_json_enc.cc | 16 ++++++++++++++++ src/rgw/rgw_rados.h | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 608cdb4899f57..6ab27b493928d 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -700,6 +700,22 @@ void rgw_obj::dump(Formatter *f) const encode_json("orig_obj", orig_obj, f); } +void RGWDefaultSystemMetaObjInfo::dump(Formatter *f) const { + encode_json("default_id", default_id, f); +} + +void RGWDefaultSystemMetaObjInfo::decode_json(JSONObj *obj) { + JSONDecoder::decode_json("default_id", default_id, obj); +} + +void RGWNameToId::dump(Formatter *f) const { + encode_json("obj_id", obj_id, f); +} + +void RGWNameToId::decode_json(JSONObj *obj) { + JSONDecoder::decode_json("obj_id", obj_id, obj); +} + void RGWZoneParams::dump(Formatter *f) const { encode_json("domain_root", domain_root.data_pool, f); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 832fa11d9ab52..3c12f04b76529 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -691,8 +691,47 @@ struct RGWListRawObjsCtx { RGWListRawObjsCtx() : initialized(false) {} }; -struct RGWRegion; +struct RGWDefaultSystemMetaObjInfo { + string default_id; + + void encode(bufferlist& bl) const { + ENCODE_START(1, 1, bl); + ::encode(default_id, bl); + ENCODE_FINISH(bl); + } + + void decode(bufferlist::iterator& bl) { + DECODE_START(1, bl); + ::decode(default_id, bl); + DECODE_FINISH(bl); + } + + void dump(Formatter *f) const; + void decode_json(JSONObj *obj); +}; +WRITE_CLASS_ENCODER(RGWDefaultSystemMetaObjInfo) + +struct RGWNameToId { + string obj_id; + void encode(bufferlist& bl) const { + ENCODE_START(1, 1, bl); + ::encode(obj_id, bl); + ENCODE_FINISH(bl); + } + + void decode(bufferlist::iterator& bl) { + DECODE_START(1, bl); + ::decode(obj_id, bl); + DECODE_FINISH(bl); + } + + void dump(Formatter *f) const; + void decode_json(JSONObj *obj); +}; +WRITE_CLASS_ENCODER(RGWNameToId) + +struct RGWRegion; struct RGWZonePlacementInfo { string index_pool; -- 2.39.5