// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
+// vim: ts=8 sw=2 smarttab ft=cpp
/*
* Ceph - scalable distributed file system
#include "rgw_http_client_curl.h"
#include "rgw_perf_counters.h"
+#include "services/svc_zone.h"
+
#include <errno.h>
#include <thread>
#include <string>
RGWObjectCtx rados_ctx(store, s); // XXX holds std::map
- auto sysobj_ctx = store->svc.sysobj->init_obj_ctx();
+ auto sysobj_ctx = store->svc()->sysobj->init_obj_ctx();
s->sysobj_ctx = &sysobj_ctx;
/* XXX and -then- stash req_state pointers everywhere they are needed */
if (ret < 0) {
if (s->system_request) {
dout(2) << "overriding permissions due to system operation" << dendl;
- } else if (s->auth.identity->is_admin_of(s->user->user_id)) {
+ } else if (s->auth.identity->is_admin_of(s->user->get_id())) {
dout(2) << "overriding permissions due to admin operation" << dendl;
} else {
abort_req(s, op, ret);
<< e.what() << dendl;
}
if (should_log) {
- rgw_log_op(store, nullptr /* !rest */, s,
+ rgw_log_op(store->getRados(), nullptr /* !rest */, s,
(op ? op->name() : "unknown"), olog);
}
if (ret < 0) {
if (s->system_request) {
dout(2) << "overriding permissions due to system operation" << dendl;
- } else if (s->auth.identity->is_admin_of(s->user->user_id)) {
+ } else if (s->auth.identity->is_admin_of(s->user->get_id())) {
dout(2) << "overriding permissions due to admin operation" << dendl;
} else {
abort_req(s, op, ret);
CODE_ENVIRONMENT_DAEMON,
CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS);
- Mutex mutex("main");
+ ceph::mutex mutex = ceph::make_mutex("main");
SafeTimer init_timer(g_ceph_context, mutex);
init_timer.init();
- mutex.Lock();
+ mutex.lock();
init_timer.add_event_after(g_conf()->rgw_init_timeout, new C_InitTimeout);
- mutex.Unlock();
+ mutex.unlock();
common_init_finish(g_ceph_context);
g_conf().get_val<bool>("rgw_dynamic_resharding"));
if (!store) {
- mutex.Lock();
+ mutex.lock();
init_timer.cancel_all_events();
init_timer.shutdown();
- mutex.Unlock();
+ mutex.unlock();
derr << "Couldn't init storage provider (RADOS)" << dendl;
return -EIO;
r = rgw_perf_start(g_ceph_context);
- rgw_rest_init(g_ceph_context, store, store->svc.zone->get_zonegroup());
+ rgw_rest_init(g_ceph_context, store->svc()->zone->get_zonegroup());
- mutex.Lock();
+ mutex.lock();
init_timer.cancel_all_events();
init_timer.shutdown();
- mutex.Unlock();
+ mutex.unlock();
if (r)
return -EIO;
ldh->init();
ldh->bind();
- rgw_user_init(store);
- rgw_bucket_init(store->meta_mgr);
- rgw_log_usage_init(g_ceph_context, store);
+ rgw_log_usage_init(g_ceph_context, store->getRados());
// XXX ex-RGWRESTMgr_lib, mgr->set_logging(true)
fe->run();
- r = store->register_to_service_map("rgw-nfs", service_map_meta);
+ r = store->getRados()->register_to_service_map("rgw-nfs", service_map_meta);
if (r < 0) {
derr << "ERROR: failed to register to service map: " << cpp_strerror(-r) << dendl;
/* ignore error */
return 0;
} /* RGWLib::stop() */
- int RGWLibIO::set_uid(RGWRados *store, const rgw_user& uid)
+ int RGWLibIO::set_uid(rgw::sal::RGWRadosStore *store, const rgw_user& uid)
{
- int ret = rgw_get_user_info_by_uid(store, uid, user_info, NULL);
+ int ret = store->ctl()->user->get_info_by_uid(uid, &user_info, null_yield);
if (ret < 0) {
derr << "ERROR: failed reading user info: uid=" << uid << " ret="
<< ret << dendl;
s->perm_mask = RGW_PERM_FULL_CONTROL;
// populate the owner info
- s->owner.set_id(s->user->user_id);
- s->owner.set_name(s->user->display_name);
+ s->owner.set_id(s->user->get_id());
+ s->owner.set_name(s->user->get_display_name());
return 0;
} /* RGWHandler_Lib::authorize */