]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move more code
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Sep 2015 00:09:58 +0000 (17:09 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:12:47 +0000 (16:12 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_cr_rados.h
src/rgw/rgw_sync.cc

index ab1844da61c6267e7969a2647d8e42e63f8417cc..8d133dfa5e57643ded5895bc062e71b74e748f01 100644 (file)
@@ -349,4 +349,61 @@ public:
   void finish();
 };
 
+class RGWAsyncWait : public RGWAsyncRadosRequest {
+  CephContext *cct;
+  Mutex *lock;
+  Cond *cond;
+  utime_t interval;
+protected:
+  int _send_request() {
+    Mutex::Locker l(*lock);
+    return cond->WaitInterval(cct, *lock, interval);
+  }
+public:
+  RGWAsyncWait(RGWAioCompletionNotifier *cn, CephContext *_cct, Mutex *_lock, Cond *_cond, int _secs) : RGWAsyncRadosRequest(cn),
+                                       cct(_cct),
+                                       lock(_lock), cond(_cond), interval(_secs, 0) {}
+
+  void wakeup() {
+    Mutex::Locker l(*lock);
+    cond->Signal();
+  }
+};
+
+class RGWWaitCR : public RGWSimpleCoroutine {
+  CephContext *cct;
+  RGWAsyncRadosProcessor *async_rados;
+  Mutex *lock;
+  Cond *cond;
+  int secs;
+
+  RGWAsyncWait *req;
+
+public:
+  RGWWaitCR(RGWAsyncRadosProcessor *_async_rados, CephContext *_cct,
+           Mutex *_lock, Cond *_cond,
+            int _secs) : RGWSimpleCoroutine(cct), cct(_cct),
+                         async_rados(_async_rados), lock(_lock), cond(_cond), secs(_secs) {
+  }
+
+  ~RGWWaitCR() {
+    wakeup();
+    delete req;
+  }
+
+  int send_request() {
+    req = new RGWAsyncWait(stack->create_completion_notifier(), cct,  lock, cond, secs);
+    async_rados->queue(req);
+    return 0;
+  }
+
+  int request_complete() {
+    return req->get_ret_status();
+  }
+
+  void wakeup() {
+    req->wakeup();
+  }
+};
+
 #endif
index eb72eecb42eb9059cecfd423bb946e6a72734e73..c849248e0eabb1e214c8b1c7a86a94f883c72ea4 100644 (file)
@@ -259,63 +259,6 @@ public:
   }
 };
 
-class RGWAsyncWait : public RGWAsyncRadosRequest {
-  CephContext *cct;
-  Mutex *lock;
-  Cond *cond;
-  utime_t interval;
-protected:
-  int _send_request() {
-    Mutex::Locker l(*lock);
-    return cond->WaitInterval(cct, *lock, interval);
-  }
-public:
-  RGWAsyncWait(RGWAioCompletionNotifier *cn, CephContext *_cct, Mutex *_lock, Cond *_cond, int _secs) : RGWAsyncRadosRequest(cn),
-                                       cct(_cct),
-                                       lock(_lock), cond(_cond), interval(_secs, 0) {}
-
-  void wakeup() {
-    Mutex::Locker l(*lock);
-    cond->Signal();
-  }
-};
-
-class RGWWaitCR : public RGWSimpleCoroutine {
-  CephContext *cct;
-  RGWAsyncRadosProcessor *async_rados;
-  Mutex *lock;
-  Cond *cond;
-  int secs;
-
-  RGWAsyncWait *req;
-
-public:
-  RGWWaitCR(RGWAsyncRadosProcessor *_async_rados, CephContext *_cct,
-           Mutex *_lock, Cond *_cond,
-            int _secs) : RGWSimpleCoroutine(cct), cct(_cct),
-                         async_rados(_async_rados), lock(_lock), cond(_cond), secs(_secs) {
-  }
-
-  ~RGWWaitCR() {
-    wakeup();
-    delete req;
-  }
-
-  int send_request() {
-    req = new RGWAsyncWait(stack->create_completion_notifier(), cct,  lock, cond, secs);
-    async_rados->queue(req);
-    return 0;
-  }
-
-  int request_complete() {
-    return req->get_ret_status();
-  }
-
-  void wakeup() {
-    req->wakeup();
-  }
-};
-
 class RGWAsyncReadMDLogEntries : public RGWAsyncRadosRequest {
   RGWRados *store;
   RGWMetadataLog *mdlog;