* Initialize the RADOS instance and prepare to do other ops
* Returns 0 on success, -ERR# on failure.
*/
-int RGWRados::initialize(const DoutPrefixProvider *dpp)
+int RGWRados::init_begin(const DoutPrefixProvider *dpp)
{
int ret;
host_id = svc.zone_utils->gen_host_id();
- ret = init_rados();
- if (ret < 0)
- return ret;
-
- return init_complete(dpp);
+ return init_rados();
}
/**
CephContext *ctx() { return cct; }
/** do all necessary setup of the storage device */
- int initialize(CephContext *_cct, const DoutPrefixProvider *dpp) {
+ int init_begin(CephContext *_cct, const DoutPrefixProvider *dpp) {
set_context(_cct);
- return initialize(dpp);
+ return init_begin(dpp);
}
/** Initialize the RADOS instance and prepare to do other ops */
int init_svc(bool raw, const DoutPrefixProvider *dpp);
int init_ctl(const DoutPrefixProvider *dpp);
virtual int init_rados();
+ int init_begin(const DoutPrefixProvider *dpp);
int init_complete(const DoutPrefixProvider *dpp);
- int initialize(const DoutPrefixProvider *dpp);
void finalize();
int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type, const std::map<std::string, std::string>& meta);
.set_run_quota_threads(quota_threads)
.set_run_sync_thread(run_sync_thread)
.set_run_reshard_thread(run_reshard_thread)
- .initialize(cct, dpp) < 0) {
+ .init_begin(cct, dpp) < 0) {
delete store;
return nullptr;
}
delete store;
return nullptr;
}
+ if (rados->init_complete(dpp) < 0) {
+ delete store;
+ return nullptr;
+ }
return store;
}
else if (svc.compare("d3n") == 0) {
.set_run_quota_threads(quota_threads)
.set_run_sync_thread(run_sync_thread)
.set_run_reshard_thread(run_reshard_thread)
- .initialize(cct, dpp) < 0) {
+ .init_begin(cct, dpp) < 0) {
+ delete store;
+ return nullptr;
+ }
+ if (store->initialize(cct, dpp) < 0) {
+ delete store;
+ return nullptr;
+ }
+ if (rados->init_complete(dpp) < 0) {
delete store;
return nullptr;
}