]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/librbd/mock/MockImageCtx.cc
import 15.2.0 Octopus source
[ceph.git] / ceph / src / test / librbd / mock / MockImageCtx.cc
index f4b2430fbbe9254b243d3155accc9d51a797e92e..dd8612ec900c22aed540db7c430c83bd04f607b7 100644 (file)
@@ -2,9 +2,25 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "test/librbd/mock/MockImageCtx.h"
+#include "test/librbd/mock/MockSafeTimer.h"
+
+static MockSafeTimer *s_timer;
+static ceph::mutex *s_timer_lock;
 
 namespace librbd {
 
 MockImageCtx* MockImageCtx::s_instance = nullptr;
 
+void MockImageCtx::set_timer_instance(MockSafeTimer *timer,
+                                      ceph::mutex *timer_lock) {
+  s_timer = timer;
+  s_timer_lock = timer_lock;
+}
+
+void MockImageCtx::get_timer_instance(CephContext *cct, MockSafeTimer **timer,
+                                      ceph::mutex **timer_lock) {
+  *timer = s_timer;
+  *timer_lock = s_timer_lock;
+}
+
 } // namespace librbd