return ret;
}
+int RGWRados::init_svc(bool raw)
+{
+ if (raw) {
+ return svc.init_raw(cct, use_cache);
+ }
+
+ return svc.init(cct, use_cache);
+}
+
/**
* Initialize the RADOS instance and prepare to do other ops
* Returns 0 on success, -ERR# on failure.
cct->_conf.get_val<double>("rgw_inject_notify_timeout_probability");
max_notify_retries = cct->_conf.get_val<uint64_t>("rgw_max_notify_retries");
- ret = svc.init(cct, use_cache);
+ ret = init_svc(false);
if (ret < 0) {
ldout(cct, 0) << "ERROR: failed to init services (ret=" << cpp_strerror(-ret) << ")" << dendl;
return ret;
store->set_context(cct);
+ int ret = store->init_svc(true);
+ if (ret < 0) {
+ ldout(cct, 0) << "ERROR: failed to init services (ret=" << cpp_strerror(-ret) << ")" << dendl;
+ return nullptr;
+ }
+
if (store->init_rados() < 0) {
delete store;
- return NULL;
+ return nullptr;
}
return store;
return initialize();
}
/** Initialize the RADOS instance and prepare to do other ops */
+ int init_svc(bool raw);
int init_rados();
int init_complete();
int initialize();
}
int RGWServices_Def::init(CephContext *cct,
- bool have_cache)
+ bool have_cache,
+ bool raw)
{
finisher = std::make_unique<RGWSI_Finisher>(cct);
notify = std::make_unique<RGWSI_Notify>(cct);
return r;
}
- r = notify->start();
- if (r < 0) {
- ldout(cct, 0) << "ERROR: failed to start notify service (" << cpp_strerror(-r) << dendl;
- return r;
+ if (!raw) {
+ r = notify->start();
+ if (r < 0) {
+ ldout(cct, 0) << "ERROR: failed to start notify service (" << cpp_strerror(-r) << dendl;
+ return r;
+ }
}
r = rados->start();
return r;
}
- r = zone->start();
- if (r < 0) {
- ldout(cct, 0) << "ERROR: failed to start zone service (" << cpp_strerror(-r) << dendl;
- return r;
+ if (!raw) {
+ r = zone->start();
+ if (r < 0) {
+ ldout(cct, 0) << "ERROR: failed to start zone service (" << cpp_strerror(-r) << dendl;
+ return r;
+ }
}
r = zone_utils->start();
}
-int RGWServices::init(CephContext *cct, bool have_cache)
+int RGWServices::do_init(CephContext *cct, bool have_cache, bool raw)
{
- int r = _svc.init(cct, have_cache);
+ int r = _svc.init(cct, have_cache, raw);
if (r < 0) {
return r;
}
RGWServices_Def();
~RGWServices_Def();
- int init(CephContext *cct, bool have_cache);
+ int init(CephContext *cct, bool have_cache, bool raw_storage);
void shutdown();
};
RGWSI_SysObj_Cache *cache{nullptr};
RGWSI_SysObj_Core *core{nullptr};
- int init(CephContext *cct, bool have_cache);
+ int do_init(CephContext *cct, bool have_cache, bool raw_storage);
+
+ int init(CephContext *cct, bool have_cache) {
+ return do_init(cct, have_cache, false);
+ }
+
+ int init_raw(CephContext *cct, bool have_cache) {
+ return do_init(cct, have_cache, true);
+ }
void shutdown() {
_svc.shutdown();
}