Skip to content

Commit 9efbe5d

Browse files
committed
RGW/standalone: removed RGWSystemMetaObj from rgw_zone
Signed-off-by: Ali Masarwa <[email protected]>
1 parent 8eb3c26 commit 9efbe5d

File tree

3 files changed

+0
-443
lines changed

3 files changed

+0
-443
lines changed

src/rgw/driver/rados/rgw_zone.cc

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -59,53 +59,6 @@ void RGWDefaultSystemMetaObjInfo::decode_json(JSONObj *obj) {
5959
JSONDecoder::decode_json("default_id", default_id, obj);
6060
}
6161

62-
int RGWSystemMetaObj::rename(const DoutPrefixProvider *dpp, const string& new_name, optional_yield y)
63-
{
64-
string new_id;
65-
int ret = read_id(dpp, new_name, new_id, y);
66-
if (!ret) {
67-
return -EEXIST;
68-
}
69-
if (ret < 0 && ret != -ENOENT) {
70-
ldpp_dout(dpp, 0) << "Error read_id " << new_name << ": " << cpp_strerror(-ret) << dendl;
71-
return ret;
72-
}
73-
string old_name = name;
74-
name = new_name;
75-
ret = update(dpp, y);
76-
if (ret < 0) {
77-
ldpp_dout(dpp, 0) << "Error storing new obj info " << new_name << ": " << cpp_strerror(-ret) << dendl;
78-
return ret;
79-
}
80-
ret = store_name(dpp, true, y);
81-
if (ret < 0) {
82-
ldpp_dout(dpp, 0) << "Error storing new name " << new_name << ": " << cpp_strerror(-ret) << dendl;
83-
return ret;
84-
}
85-
/* delete old name */
86-
rgw_pool pool(get_pool(cct));
87-
string oid = get_names_oid_prefix() + old_name;
88-
rgw_raw_obj old_name_obj(pool, oid);
89-
auto sysobj = sysobj_svc->get_obj(old_name_obj);
90-
ret = sysobj.wop().remove(dpp, y);
91-
if (ret < 0) {
92-
ldpp_dout(dpp, 0) << "Error delete old obj name " << old_name << ": " << cpp_strerror(-ret) << dendl;
93-
return ret;
94-
}
95-
96-
return ret;
97-
}
98-
99-
int RGWSystemMetaObj::read(const DoutPrefixProvider *dpp, optional_yield y)
100-
{
101-
int ret = read_id(dpp, name, id, y);
102-
if (ret < 0) {
103-
return ret;
104-
}
105-
106-
return read_info(dpp, id, y);
107-
}
108-
10962
const string& RGWZoneParams::get_compression_type(const rgw_placement_rule& placement_rule) const
11063
{
11164
static const std::string NONE{"none"};

src/rgw/driver/rados/rgw_zone.h

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -10,93 +10,6 @@
1010
#include "rgw_sync_policy.h"
1111

1212

13-
class RGWSyncModulesManager;
14-
15-
class RGWSI_SysObj;
16-
class RGWSI_Zone;
17-
18-
class RGWSystemMetaObj {
19-
public:
20-
std::string id;
21-
std::string name;
22-
23-
CephContext *cct{nullptr};
24-
RGWSI_SysObj *sysobj_svc{nullptr};
25-
RGWSI_Zone *zone_svc{nullptr};
26-
27-
int store_name(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y);
28-
int store_info(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y);
29-
int read_info(const DoutPrefixProvider *dpp, const std::string& obj_id, optional_yield y, bool old_format = false);
30-
int read_id(const DoutPrefixProvider *dpp, const std::string& obj_name, std::string& obj_id, optional_yield y);
31-
int read_default(const DoutPrefixProvider *dpp,
32-
RGWDefaultSystemMetaObjInfo& default_info,
33-
const std::string& oid,
34-
optional_yield y);
35-
/* read and use default id */
36-
int use_default(const DoutPrefixProvider *dpp, optional_yield y, bool old_format = false);
37-
38-
public:
39-
RGWSystemMetaObj() {}
40-
RGWSystemMetaObj(const std::string& _name): name(_name) {}
41-
RGWSystemMetaObj(const std::string& _id, const std::string& _name) : id(_id), name(_name) {}
42-
RGWSystemMetaObj(CephContext *_cct, RGWSI_SysObj *_sysobj_svc) {
43-
reinit_instance(_cct, _sysobj_svc);
44-
}
45-
RGWSystemMetaObj(const std::string& _name, CephContext *_cct, RGWSI_SysObj *_sysobj_svc): name(_name) {
46-
reinit_instance(_cct, _sysobj_svc);
47-
}
48-
49-
const std::string& get_name() const { return name; }
50-
const std::string& get_id() const { return id; }
51-
52-
void set_name(const std::string& _name) { name = _name;}
53-
void set_id(const std::string& _id) { id = _id;}
54-
void clear_id() { id.clear(); }
55-
56-
virtual ~RGWSystemMetaObj() {}
57-
58-
virtual void encode(bufferlist& bl) const {
59-
ENCODE_START(1, 1, bl);
60-
encode(id, bl);
61-
encode(name, bl);
62-
ENCODE_FINISH(bl);
63-
}
64-
65-
virtual void decode(bufferlist::const_iterator& bl) {
66-
DECODE_START(1, bl);
67-
decode(id, bl);
68-
decode(name, bl);
69-
DECODE_FINISH(bl);
70-
}
71-
72-
void reinit_instance(CephContext *_cct, RGWSI_SysObj *_sysobj_svc);
73-
int init(const DoutPrefixProvider *dpp, CephContext *_cct, RGWSI_SysObj *_sysobj_svc,
74-
optional_yield y,
75-
bool setup_obj = true, bool old_format = false);
76-
virtual int read_default_id(const DoutPrefixProvider *dpp, std::string& default_id, optional_yield y,
77-
bool old_format = false);
78-
virtual int set_as_default(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = false);
79-
int delete_default();
80-
virtual int create(const DoutPrefixProvider *dpp, optional_yield y, bool exclusive = true);
81-
int delete_obj(const DoutPrefixProvider *dpp, optional_yield y, bool old_format = false);
82-
int rename(const DoutPrefixProvider *dpp, const std::string& new_name, optional_yield y);
83-
int update(const DoutPrefixProvider *dpp, optional_yield y) { return store_info(dpp, false, y);}
84-
int update_name(const DoutPrefixProvider *dpp, optional_yield y) { return store_name(dpp, false, y);}
85-
int read(const DoutPrefixProvider *dpp, optional_yield y);
86-
int write(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y);
87-
88-
virtual rgw_pool get_pool(CephContext *cct) const = 0;
89-
virtual const std::string get_default_oid(bool old_format = false) const = 0;
90-
virtual const std::string& get_names_oid_prefix() const = 0;
91-
virtual const std::string& get_info_oid_prefix(bool old_format = false) const = 0;
92-
virtual std::string get_predefined_id(CephContext *cct) const = 0;
93-
virtual const std::string& get_predefined_name(CephContext *cct) const = 0;
94-
95-
void dump(Formatter *f) const;
96-
void decode_json(JSONObj *obj);
97-
};
98-
WRITE_CLASS_ENCODER(RGWSystemMetaObj)
99-
10013
struct RGWZoneParams {
10114
std::string id;
10215
std::string name;

0 commit comments

Comments
 (0)