}
struct req_state* s = req->get_state();
+ RGWLibIO& io_ctx = req->get_io();
+ RGWEnv& rgw_env = io_ctx.get_env();
+ RGWObjectCtx& rados_ctx = req->get_octx();
+
+ rgw_env.set("HTTP_HOST", "");
+
+ int ret = req->init(rgw_env, &rados_ctx, &io_ctx, s);
+ if (ret < 0) {
+ dout(10) << "failed to initialize request" << dendl;
+ abort_req(s, op, ret);
+ goto done;
+ }
/* req is-a RGWOp, currently initialized separately */
- int ret = req->op_init();
+ ret = req->op_init();
if (ret < 0) {
dout(10) << "failed to initialize RGWOp" << dendl;
abort_req(s, op, ret);
<< " op status=" << op_ret
<< " ======" << dendl;
+ perfcounter->inc(l_rgw_req);
+
return ret;
}
int RGWWriteRequest::exec_start() {
struct req_state* state = get_state();
+ /* Object needs a bucket from this point */
+ state->object->set_bucket(state->bucket.get());
+
auto compression_type =
get_store()->svc()->zone->get_zone_params().get_compression_type(
state->bucket->get_placement_rule());
size_t bytes_written;
bool eio;
- RGWWriteRequest(rgw::sal::RGWRadosStore* store, std::unique_ptr<rgw::sal::RGWUser> _user,
- RGWFileHandle* _fh, const std::string& _bname, const std::string& _oname)
+ RGWWriteRequest(rgw::sal::RGWRadosStore* store,
+ std::unique_ptr<rgw::sal::RGWUser> _user,
+ RGWFileHandle* _fh, const std::string& _bname,
+ const std::string& _oname)
: RGWLibContinuedReq(store->ctx(), std::move(_user)),
bucket_name(_bname), obj_name(_oname),
rgw_fh(_fh), filter(nullptr), timer_id(0), real_ofs(0),
RGWObjectCtx rados_ctx;
public:
- RGWLibContinuedReq(CephContext* _cct, std::unique_ptr<rgw::sal::RGWUser> _user)
+ RGWLibContinuedReq(CephContext* _cct,
+ std::unique_ptr<rgw::sal::RGWUser> _user)
: RGWLibRequest(_cct, std::move(_user)), io_ctx(),
rstate(_cct, &io_ctx.get_env(), id),
rados_ctx(rgwlib.get_store(), &rstate)
sysobj_ctx.emplace(store->svc()->sysobj);
+ get_state()->cio = &io_ctx;
get_state()->obj_ctx = &rados_ctx;
get_state()->sysobj_ctx = &(sysobj_ctx.get());
get_state()->req_id = store->svc()->zone_utils->unique_id(id);
}
inline rgw::sal::RGWRadosStore* get_store() { return store; }
+ inline RGWLibIO& get_io() { return io_ctx; }
+ inline RGWObjectCtx& get_octx() { return rados_ctx; }
virtual int execute() final { ceph_abort(); }
virtual int exec_start() = 0;