]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove unused RGWWaitCR
authorCasey Bodley <cbodley@redhat.com>
Tue, 31 Mar 2020 13:22:11 +0000 (09:22 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 13 Apr 2020 15:06:46 +0000 (11:06 -0400)
coroutines that want to sleep should just call RGWCoroutine::wait()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_cr_rados.h

index 36752997eb4263af7489aa13c2c980b5c3de3e90..e3a9e3c465a3f3b335cbfe3d73f1591313460c38 100644 (file)
@@ -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;