2 #include "rgw_coroutine.h"
3 #include "rgw_cr_rados.h"
5 #include "cls/lock/cls_lock_client.h"
7 #include <boost/asio/yield.hpp>
9 #define dout_context g_ceph_context
10 #define dout_subsys ceph_subsys_rgw
12 bool RGWAsyncRadosProcessor::RGWWQ::_enqueue(RGWAsyncRadosRequest
*req
) {
13 if (processor
->is_going_down()) {
17 processor
->m_req_queue
.push_back(req
);
18 dout(20) << "enqueued request req=" << hex
<< req
<< dec
<< dendl
;
23 bool RGWAsyncRadosProcessor::RGWWQ::_empty() {
24 return processor
->m_req_queue
.empty();
27 RGWAsyncRadosRequest
*RGWAsyncRadosProcessor::RGWWQ::_dequeue() {
28 if (processor
->m_req_queue
.empty())
30 RGWAsyncRadosRequest
*req
= processor
->m_req_queue
.front();
31 processor
->m_req_queue
.pop_front();
32 dout(20) << "dequeued request req=" << hex
<< req
<< dec
<< dendl
;
37 void RGWAsyncRadosProcessor::RGWWQ::_process(RGWAsyncRadosRequest
*req
, ThreadPool::TPHandle
& handle
) {
38 processor
->handle_request(req
);
39 processor
->req_throttle
.put(1);
42 void RGWAsyncRadosProcessor::RGWWQ::_dump_queue() {
43 if (!g_conf
->subsys
.should_gather(ceph_subsys_rgw
, 20)) {
46 deque
<RGWAsyncRadosRequest
*>::iterator iter
;
47 if (processor
->m_req_queue
.empty()) {
48 dout(20) << "RGWWQ: empty" << dendl
;
51 dout(20) << "RGWWQ:" << dendl
;
52 for (iter
= processor
->m_req_queue
.begin(); iter
!= processor
->m_req_queue
.end(); ++iter
) {
53 dout(20) << "req: " << hex
<< *iter
<< dec
<< dendl
;
57 RGWAsyncRadosProcessor::RGWAsyncRadosProcessor(RGWRados
*_store
, int num_threads
)
58 : store(_store
), m_tp(store
->ctx(), "RGWAsyncRadosProcessor::m_tp", "rados_async", num_threads
),
59 req_throttle(store
->ctx(), "rgw_async_rados_ops", num_threads
* 2),
60 req_wq(this, g_conf
->rgw_op_thread_timeout
,
61 g_conf
->rgw_op_thread_suicide_timeout
, &m_tp
) {
64 void RGWAsyncRadosProcessor::start() {
68 void RGWAsyncRadosProcessor::stop() {
72 for (auto iter
= m_req_queue
.begin(); iter
!= m_req_queue
.end(); ++iter
) {
77 void RGWAsyncRadosProcessor::handle_request(RGWAsyncRadosRequest
*req
) {
82 void RGWAsyncRadosProcessor::queue(RGWAsyncRadosRequest
*req
) {
87 int RGWAsyncGetSystemObj::_send_request()
89 return store
->get_system_obj(*obj_ctx
, read_state
, objv_tracker
, obj
, *pbl
, ofs
, end
, pattrs
, NULL
);
92 RGWAsyncGetSystemObj::RGWAsyncGetSystemObj(RGWCoroutine
*caller
, RGWAioCompletionNotifier
*cn
, RGWRados
*_store
, RGWObjectCtx
*_obj_ctx
,
93 RGWObjVersionTracker
*_objv_tracker
, const rgw_raw_obj
& _obj
,
94 bufferlist
*_pbl
, off_t _ofs
, off_t _end
) : RGWAsyncRadosRequest(caller
, cn
), store(_store
), obj_ctx(_obj_ctx
),
95 objv_tracker(_objv_tracker
), obj(_obj
), pbl(_pbl
), pattrs(NULL
),
100 int RGWSimpleRadosReadAttrsCR::send_request()
102 req
= new RGWAsyncGetSystemObj(this, stack
->create_completion_notifier(),
103 store
, &obj_ctx
, NULL
,
107 req
->set_read_attrs(pattrs
);
109 async_rados
->queue(req
);
113 int RGWSimpleRadosReadAttrsCR::request_complete()
115 return req
->get_ret_status();
118 int RGWAsyncPutSystemObj::_send_request()
120 return store
->put_system_obj_data(NULL
, obj
, bl
, -1, exclusive
, objv_tracker
);
123 RGWAsyncPutSystemObj::RGWAsyncPutSystemObj(RGWCoroutine
*caller
, RGWAioCompletionNotifier
*cn
, RGWRados
*_store
,
124 RGWObjVersionTracker
*_objv_tracker
, rgw_raw_obj
& _obj
,
125 bool _exclusive
, bufferlist
& _bl
)
126 : RGWAsyncRadosRequest(caller
, cn
), store(_store
), objv_tracker(_objv_tracker
),
127 obj(_obj
), exclusive(_exclusive
), bl(_bl
)
131 int RGWAsyncPutSystemObjAttrs::_send_request()
133 return store
->system_obj_set_attrs(NULL
, obj
, *attrs
, NULL
, objv_tracker
);
136 RGWAsyncPutSystemObjAttrs::RGWAsyncPutSystemObjAttrs(RGWCoroutine
*caller
, RGWAioCompletionNotifier
*cn
, RGWRados
*_store
,
137 RGWObjVersionTracker
*_objv_tracker
, const rgw_raw_obj
& _obj
,
138 map
<string
, bufferlist
> *_attrs
) : RGWAsyncRadosRequest(caller
, cn
), store(_store
),
139 objv_tracker(_objv_tracker
), obj(_obj
),
145 RGWOmapAppend::RGWOmapAppend(RGWAsyncRadosProcessor
*_async_rados
, RGWRados
*_store
, const rgw_raw_obj
& _obj
,
146 uint64_t _window_size
)
147 : RGWConsumerCR
<string
>(_store
->ctx()), async_rados(_async_rados
),
148 store(_store
), obj(_obj
), going_down(false), num_pending_entries(0), window_size(_window_size
), total_entries(0)
152 int RGWAsyncLockSystemObj::_send_request()
155 int r
= store
->get_raw_obj_ref(obj
, &ref
);
157 lderr(store
->ctx()) << "ERROR: failed to get ref for (" << obj
<< ") ret=" << r
<< dendl
;
161 rados::cls::lock::Lock
l(lock_name
);
162 utime_t
duration(duration_secs
, 0);
163 l
.set_duration(duration
);
164 l
.set_cookie(cookie
);
167 return l
.lock_exclusive(&ref
.ioctx
, ref
.oid
);
170 RGWAsyncLockSystemObj::RGWAsyncLockSystemObj(RGWCoroutine
*caller
, RGWAioCompletionNotifier
*cn
, RGWRados
*_store
,
171 RGWObjVersionTracker
*_objv_tracker
, const rgw_raw_obj
& _obj
,
172 const string
& _name
, const string
& _cookie
, uint32_t _duration_secs
) : RGWAsyncRadosRequest(caller
, cn
), store(_store
),
176 duration_secs(_duration_secs
)
180 int RGWAsyncUnlockSystemObj::_send_request()
183 int r
= store
->get_raw_obj_ref(obj
, &ref
);
185 lderr(store
->ctx()) << "ERROR: failed to get ref for (" << obj
<< ") ret=" << r
<< dendl
;
189 rados::cls::lock::Lock
l(lock_name
);
191 l
.set_cookie(cookie
);
193 return l
.unlock(&ref
.ioctx
, ref
.oid
);
196 RGWAsyncUnlockSystemObj::RGWAsyncUnlockSystemObj(RGWCoroutine
*caller
, RGWAioCompletionNotifier
*cn
, RGWRados
*_store
,
197 RGWObjVersionTracker
*_objv_tracker
, const rgw_raw_obj
& _obj
,
198 const string
& _name
, const string
& _cookie
) : RGWAsyncRadosRequest(caller
, cn
), store(_store
),
200 lock_name(_name
), cookie(_cookie
)
205 RGWRadosSetOmapKeysCR::RGWRadosSetOmapKeysCR(RGWRados
*_store
,
206 const rgw_raw_obj
& _obj
,
207 map
<string
, bufferlist
>& _entries
) : RGWSimpleCoroutine(_store
->ctx()),
212 stringstream
& s
= set_description();
213 s
<< "set omap keys dest=" << obj
<< " keys=[" << s
.str() << "]";
214 for (auto i
= entries
.begin(); i
!= entries
.end(); ++i
) {
215 if (i
!= entries
.begin()) {
223 int RGWRadosSetOmapKeysCR::send_request()
225 int r
= store
->get_raw_obj_ref(obj
, &ref
);
227 lderr(store
->ctx()) << "ERROR: failed to get ref for (" << obj
<< ") ret=" << r
<< dendl
;
231 set_status() << "sending request";
233 librados::ObjectWriteOperation op
;
234 op
.omap_set(entries
);
236 cn
= stack
->create_completion_notifier();
237 return ref
.ioctx
.aio_operate(ref
.oid
, cn
->completion(), &op
);
240 int RGWRadosSetOmapKeysCR::request_complete()
242 int r
= cn
->completion()->get_return_value();
244 set_status() << "request complete; ret=" << r
;
249 RGWRadosGetOmapKeysCR::RGWRadosGetOmapKeysCR(RGWRados
*_store
,
250 const rgw_raw_obj
& _obj
,
251 const string
& _marker
,
252 map
<string
, bufferlist
> *_entries
, int _max_entries
) : RGWSimpleCoroutine(_store
->ctx()),
255 entries(_entries
), max_entries(_max_entries
), rval(0),
258 set_description() << "set omap keys dest=" << obj
<< " marker=" << marker
;
261 int RGWRadosGetOmapKeysCR::send_request() {
262 int r
= store
->get_raw_obj_ref(obj
, &ref
);
264 lderr(store
->ctx()) << "ERROR: failed to get ref for (" << obj
<< ") ret=" << r
<< dendl
;
268 set_status() << "send request";
270 librados::ObjectReadOperation op
;
271 op
.omap_get_vals2(marker
, max_entries
, entries
, nullptr, &rval
);
273 cn
= stack
->create_completion_notifier();
274 return ref
.ioctx
.aio_operate(ref
.oid
, cn
->completion(), &op
, NULL
);
277 RGWRadosRemoveOmapKeysCR::RGWRadosRemoveOmapKeysCR(RGWRados
*_store
,
278 const rgw_raw_obj
& _obj
,
279 const set
<string
>& _keys
) : RGWSimpleCoroutine(_store
->ctx()),
284 set_description() << "remove omap keys dest=" << obj
<< " keys=" << keys
;
287 int RGWRadosRemoveOmapKeysCR::send_request() {
288 int r
= store
->get_raw_obj_ref(obj
, &ref
);
290 lderr(store
->ctx()) << "ERROR: failed to get ref for (" << obj
<< ") ret=" << r
<< dendl
;
294 set_status() << "send request";
296 librados::ObjectWriteOperation op
;
297 op
.omap_rm_keys(keys
);
299 cn
= stack
->create_completion_notifier();
300 return ref
.ioctx
.aio_operate(ref
.oid
, cn
->completion(), &op
);
303 int RGWRadosRemoveOmapKeysCR::request_complete()
305 int r
= cn
->completion()->get_return_value();
307 set_status() << "request complete; ret=" << r
;
312 RGWRadosRemoveCR::RGWRadosRemoveCR(RGWRados
*store
, const rgw_raw_obj
& obj
)
313 : RGWSimpleCoroutine(store
->ctx()), store(store
), obj(obj
)
315 set_description() << "remove dest=" << obj
;
318 int RGWRadosRemoveCR::send_request()
320 auto rados
= store
->get_rados_handle();
321 int r
= rados
->ioctx_create(obj
.pool
.name
.c_str(), ioctx
);
323 lderr(cct
) << "ERROR: failed to open pool (" << obj
.pool
.name
<< ") ret=" << r
<< dendl
;
326 ioctx
.locator_set_key(obj
.loc
);
328 set_status() << "send request";
330 librados::ObjectWriteOperation op
;
333 cn
= stack
->create_completion_notifier();
334 return ioctx
.aio_operate(obj
.oid
, cn
->completion(), &op
);
337 int RGWRadosRemoveCR::request_complete()
339 int r
= cn
->completion()->get_return_value();
341 set_status() << "request complete; ret=" << r
;
346 RGWSimpleRadosLockCR::RGWSimpleRadosLockCR(RGWAsyncRadosProcessor
*_async_rados
, RGWRados
*_store
,
347 const rgw_raw_obj
& _obj
,
348 const string
& _lock_name
,
349 const string
& _cookie
,
350 uint32_t _duration
) : RGWSimpleCoroutine(_store
->ctx()),
351 async_rados(_async_rados
),
353 lock_name(_lock_name
),
359 set_description() << "rados lock dest=" << obj
<< " lock=" << lock_name
<< " cookie=" << cookie
<< " duration=" << duration
;
362 void RGWSimpleRadosLockCR::request_cleanup()
370 int RGWSimpleRadosLockCR::send_request()
372 set_status() << "sending request";
373 req
= new RGWAsyncLockSystemObj(this, stack
->create_completion_notifier(),
374 store
, NULL
, obj
, lock_name
, cookie
, duration
);
375 async_rados
->queue(req
);
379 int RGWSimpleRadosLockCR::request_complete()
381 set_status() << "request complete; ret=" << req
->get_ret_status();
382 return req
->get_ret_status();
385 RGWSimpleRadosUnlockCR::RGWSimpleRadosUnlockCR(RGWAsyncRadosProcessor
*_async_rados
, RGWRados
*_store
,
386 const rgw_raw_obj
& _obj
,
387 const string
& _lock_name
,
388 const string
& _cookie
) : RGWSimpleCoroutine(_store
->ctx()),
389 async_rados(_async_rados
),
391 lock_name(_lock_name
),
396 set_description() << "rados unlock dest=" << obj
<< " lock=" << lock_name
<< " cookie=" << cookie
;
399 void RGWSimpleRadosUnlockCR::request_cleanup()
407 int RGWSimpleRadosUnlockCR::send_request()
409 set_status() << "sending request";
411 req
= new RGWAsyncUnlockSystemObj(this, stack
->create_completion_notifier(),
412 store
, NULL
, obj
, lock_name
, cookie
);
413 async_rados
->queue(req
);
417 int RGWSimpleRadosUnlockCR::request_complete()
419 set_status() << "request complete; ret=" << req
->get_ret_status();
420 return req
->get_ret_status();
424 int RGWOmapAppend::operate() {
427 if (!has_product() && going_down
) {
428 set_status() << "going down";
431 set_status() << "waiting for product";
432 yield
wait_for_product();
435 while (consume(&entry
)) {
436 set_status() << "adding entry: " << entry
;
437 entries
[entry
] = bufferlist();
438 if (entries
.size() >= window_size
) {
442 if (entries
.size() >= window_size
|| going_down
) {
443 set_status() << "flushing to omap";
444 call(new RGWRadosSetOmapKeysCR(store
, obj
, entries
));
448 if (get_ret_status() < 0) {
449 ldout(cct
, 0) << "ERROR: failed to store entries in omap" << dendl
;
450 return set_state(RGWCoroutine_Error
);
453 /* done with coroutine */
454 return set_state(RGWCoroutine_Done
);
459 void RGWOmapAppend::flush_pending() {
460 receive(pending_entries
);
461 num_pending_entries
= 0;
464 bool RGWOmapAppend::append(const string
& s
) {
469 pending_entries
.push_back(s
);
470 if (++num_pending_entries
>= (int)window_size
) {
476 bool RGWOmapAppend::finish() {
483 int RGWAsyncGetBucketInstanceInfo::_send_request()
485 RGWObjectCtx
obj_ctx(store
);
486 int r
= store
->get_bucket_instance_info(obj_ctx
, bucket
, *bucket_info
, NULL
, NULL
);
488 ldout(store
->ctx(), 0) << "ERROR: failed to get bucket instance info for "
496 int RGWAsyncFetchRemoteObj::_send_request()
498 RGWObjectCtx
obj_ctx(store
);
502 snprintf(buf
, sizeof(buf
), ".%lld", (long long)store
->instance_id());
503 string client_id
= store
->zone_id() + buf
;
504 string op_id
= store
->unique_id(store
->get_new_req_id());
505 map
<string
, bufferlist
> attrs
;
507 rgw_obj
src_obj(bucket_info
.bucket
, key
);
509 rgw_obj
dest_obj(src_obj
);
511 int r
= store
->fetch_remote_obj(obj_ctx
,
515 false, /* don't record op state in ops log */
520 bucket_info
, /* dest */
521 bucket_info
, /* source */
522 NULL
, /* real_time* src_mtime, */
523 NULL
, /* real_time* mtime, */
524 NULL
, /* const real_time* mod_ptr, */
525 NULL
, /* const real_time* unmod_ptr, */
526 false, /* high precision time */
527 NULL
, /* const char *if_match, */
528 NULL
, /* const char *if_nomatch, */
529 RGWRados::ATTRSMOD_NONE
,
532 RGW_OBJ_CATEGORY_MAIN
,
534 real_time(), /* delete_at */
535 &key
.instance
, /* string *version_id, */
536 NULL
, /* string *ptag, */
537 NULL
, /* string *petag, */
538 NULL
, /* void (*progress_cb)(off_t, void *), */
539 NULL
, /* void *progress_data*); */
543 ldout(store
->ctx(), 0) << "store->fetch_remote_obj() returned r=" << r
<< dendl
;
548 int RGWAsyncStatRemoteObj::_send_request()
550 RGWObjectCtx
obj_ctx(store
);
554 snprintf(buf
, sizeof(buf
), ".%lld", (long long)store
->instance_id());
555 string client_id
= store
->zone_id() + buf
;
556 string op_id
= store
->unique_id(store
->get_new_req_id());
558 rgw_obj
src_obj(bucket_info
.bucket
, key
);
560 rgw_obj
dest_obj(src_obj
);
562 int r
= store
->stat_remote_obj(obj_ctx
,
565 nullptr, /* req_info */
568 bucket_info
, /* source */
569 pmtime
, /* real_time* src_mtime, */
570 psize
, /* uint64_t * */
571 nullptr, /* const real_time* mod_ptr, */
572 nullptr, /* const real_time* unmod_ptr, */
573 true, /* high precision time */
574 nullptr, /* const char *if_match, */
575 nullptr, /* const char *if_nomatch, */
578 nullptr, /* string *ptag, */
579 nullptr); /* string *petag, */
582 ldout(store
->ctx(), 0) << "store->fetch_remote_obj() returned r=" << r
<< dendl
;
588 int RGWAsyncRemoveObj::_send_request()
590 RGWObjectCtx
obj_ctx(store
);
592 rgw_obj
obj(bucket_info
.bucket
, key
);
594 ldout(store
->ctx(), 0) << __func__
<< "(): deleting obj=" << obj
<< dendl
;
596 obj_ctx
.obj
.set_atomic(obj
);
600 int ret
= store
->get_obj_state(&obj_ctx
, bucket_info
, obj
, &state
);
602 ldout(store
->ctx(), 20) << __func__
<< "(): get_obj_state() obj=" << obj
<< " returned ret=" << ret
<< dendl
;
606 /* has there been any racing object write? */
607 if (del_if_older
&& (state
->mtime
> timestamp
)) {
608 ldout(store
->ctx(), 20) << __func__
<< "(): skipping object removal obj=" << obj
<< " (obj mtime=" << state
->mtime
<< ", request timestamp=" << timestamp
<< ")" << dendl
;
612 RGWAccessControlPolicy policy
;
615 map
<string
, bufferlist
>::iterator iter
= state
->attrset
.find(RGW_ATTR_ACL
);
616 if (iter
!= state
->attrset
.end()) {
617 bufferlist::iterator bliter
= iter
->second
.begin();
619 policy
.decode(bliter
);
620 } catch (buffer::error
& err
) {
621 ldout(store
->ctx(), 0) << "ERROR: could not decode policy, caught buffer::error" << dendl
;
626 RGWRados::Object
del_target(store
, bucket_info
, obj_ctx
, obj
);
627 RGWRados::Object::Delete
del_op(&del_target
);
629 del_op
.params
.bucket_owner
= bucket_info
.owner
;
630 del_op
.params
.obj_owner
= policy
.get_owner();
632 del_op
.params
.unmod_since
= timestamp
;
635 del_op
.params
.versioning_status
= BUCKET_VERSIONED
;
637 del_op
.params
.olh_epoch
= versioned_epoch
;
638 del_op
.params
.marker_version_id
= marker_version_id
;
639 del_op
.params
.obj_owner
.set_id(owner
);
640 del_op
.params
.obj_owner
.set_name(owner_display_name
);
641 del_op
.params
.mtime
= timestamp
;
642 del_op
.params
.high_precision_time
= true;
643 del_op
.params
.zones_trace
= zones_trace
;
645 ret
= del_op
.delete_obj();
647 ldout(store
->ctx(), 20) << __func__
<< "(): delete_obj() obj=" << obj
<< " returned ret=" << ret
<< dendl
;
652 int RGWContinuousLeaseCR::operate()
655 caller
->set_sleeping(false);
656 return set_cr_done();
659 while (!going_down
) {
660 yield
call(new RGWSimpleRadosLockCR(async_rados
, store
, obj
, lock_name
, cookie
, interval
));
662 caller
->set_sleeping(false); /* will only be relevant when we return, that's why we can do it early */
665 ldout(store
->ctx(), 20) << *this << ": couldn't lock " << obj
<< ":" << lock_name
<< ": retcode=" << retcode
<< dendl
;
666 return set_state(RGWCoroutine_Error
, retcode
);
669 yield
wait(utime_t(interval
/ 2, 0));
671 set_locked(false); /* moot at this point anyway */
672 yield
call(new RGWSimpleRadosUnlockCR(async_rados
, store
, obj
, lock_name
, cookie
));
673 return set_state(RGWCoroutine_Done
);
678 RGWRadosTimelogAddCR::RGWRadosTimelogAddCR(RGWRados
*_store
, const string
& _oid
,
679 const cls_log_entry
& entry
) : RGWSimpleCoroutine(_store
->ctx()),
683 stringstream
& s
= set_description();
684 s
<< "timelog add entry oid=" << oid
<< "entry={id=" << entry
.id
<< ", section=" << entry
.section
<< ", name=" << entry
.name
<< "}";
685 entries
.push_back(entry
);
688 int RGWRadosTimelogAddCR::send_request()
690 set_status() << "sending request";
692 cn
= stack
->create_completion_notifier();
693 return store
->time_log_add(oid
, entries
, cn
->completion(), true);
696 int RGWRadosTimelogAddCR::request_complete()
698 int r
= cn
->completion()->get_return_value();
700 set_status() << "request complete; ret=" << r
;
705 RGWRadosTimelogTrimCR::RGWRadosTimelogTrimCR(RGWRados
*store
,
706 const std::string
& oid
,
707 const real_time
& start_time
,
708 const real_time
& end_time
,
709 const std::string
& from_marker
,
710 const std::string
& to_marker
)
711 : RGWSimpleCoroutine(store
->ctx()), store(store
), oid(oid
),
712 start_time(start_time
), end_time(end_time
),
713 from_marker(from_marker
), to_marker(to_marker
)
715 set_description() << "timelog trim oid=" << oid
716 << " start_time=" << start_time
<< " end_time=" << end_time
717 << " from_marker=" << from_marker
<< " to_marker=" << to_marker
;
720 int RGWRadosTimelogTrimCR::send_request()
722 set_status() << "sending request";
724 cn
= stack
->create_completion_notifier();
725 return store
->time_log_trim(oid
, start_time
, end_time
, from_marker
,
726 to_marker
, cn
->completion());
729 int RGWRadosTimelogTrimCR::request_complete()
731 int r
= cn
->completion()->get_return_value();
733 set_status() << "request complete; ret=" << r
;
739 RGWSyncLogTrimCR::RGWSyncLogTrimCR(RGWRados
*store
, const std::string
& oid
,
740 const std::string
& to_marker
,
741 std::string
*last_trim_marker
)
742 : RGWRadosTimelogTrimCR(store
, oid
, real_time
{}, real_time
{},
743 std::string
{}, to_marker
),
744 cct(store
->ctx()), last_trim_marker(last_trim_marker
)
748 int RGWSyncLogTrimCR::request_complete()
750 int r
= RGWRadosTimelogTrimCR::request_complete();
751 if (r
< 0 && r
!= -ENODATA
) {
754 if (*last_trim_marker
< to_marker
) {
755 *last_trim_marker
= to_marker
;
761 int RGWAsyncStatObj::_send_request()
764 store
->obj_to_raw(bucket_info
.placement_rule
, obj
, &raw_obj
);
765 return store
->raw_obj_stat(raw_obj
, psize
, pmtime
, pepoch
,
766 nullptr, nullptr, objv_tracker
);
769 RGWStatObjCR::RGWStatObjCR(RGWAsyncRadosProcessor
*async_rados
, RGWRados
*store
,
770 const RGWBucketInfo
& _bucket_info
, const rgw_obj
& obj
, uint64_t *psize
,
771 real_time
* pmtime
, uint64_t *pepoch
,
772 RGWObjVersionTracker
*objv_tracker
)
773 : RGWSimpleCoroutine(store
->ctx()), store(store
), async_rados(async_rados
),
774 bucket_info(_bucket_info
), obj(obj
), psize(psize
), pmtime(pmtime
), pepoch(pepoch
),
775 objv_tracker(objv_tracker
)
779 void RGWStatObjCR::request_cleanup()
787 int RGWStatObjCR::send_request()
789 req
= new RGWAsyncStatObj(this, stack
->create_completion_notifier(),
790 store
, bucket_info
, obj
, psize
, pmtime
, pepoch
, objv_tracker
);
791 async_rados
->queue(req
);
795 int RGWStatObjCR::request_complete()
797 return req
->get_ret_status();