From 703e40348ad32d998e64c27553091d324f7632d8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 31 Mar 2020 09:22:11 -0400 Subject: [PATCH] rgw: remove unused RGWWaitCR coroutines that want to sleep should just call RGWCoroutine::wait() Signed-off-by: Casey Bodley --- src/rgw/rgw_cr_rados.h | 66 ------------------------------------------ 1 file changed, 66 deletions(-) diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index 36752997eb426..e3a9e3c465a3f 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -740,72 +740,6 @@ public: } }; -class RGWAsyncWait : public RGWAsyncRadosRequest { - CephContext *cct; - ceph::mutex *lock; - ceph::condition_variable *cond; - std::chrono::seconds interval; -protected: - int _send_request() override { - std::unique_lock l{*lock}; - return (cond->wait_for(l, interval) == std::cv_status::timeout ? - ETIMEDOUT : 0); - } -public: - RGWAsyncWait(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, CephContext *_cct, - ceph::mutex *_lock, ceph::condition_variable *_cond, int _secs) - : RGWAsyncRadosRequest(caller, cn), - cct(_cct), - lock(_lock), cond(_cond), interval(_secs) {} - - void wakeup() { - std::lock_guard l{*lock}; - cond->notify_all(); - } -}; - -class RGWWaitCR : public RGWSimpleCoroutine { - CephContext *cct; - RGWAsyncRadosProcessor *async_rados; - ceph::mutex *lock; - ceph::condition_variable *cond; - int secs; - - RGWAsyncWait *req; - -public: - RGWWaitCR(RGWAsyncRadosProcessor *_async_rados, CephContext *_cct, - ceph::mutex *_lock, ceph::condition_variable *_cond, - int _secs) : RGWSimpleCoroutine(_cct), cct(_cct), - async_rados(_async_rados), lock(_lock), cond(_cond), secs(_secs), req(NULL) { - } - ~RGWWaitCR() override { - request_cleanup(); - } - - void request_cleanup() override { - if (req) { - wakeup(); - req->finish(); - req = NULL; - } - } - - int send_request() override { - req = new RGWAsyncWait(this, stack->create_completion_notifier(), cct, lock, cond, secs); - async_rados->queue(req); - return 0; - } - - int request_complete() override { - return req->get_ret_status(); - } - - void wakeup() { - req->wakeup(); - } -}; - class RGWShardedOmapCRManager { RGWAsyncRadosProcessor *async_rados; rgw::sal::RGWRadosStore *store; -- 2.39.5