]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: journal type traits should be standalone
authorJason Dillaman <dillaman@redhat.com>
Mon, 21 Mar 2016 20:52:07 +0000 (16:52 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 29 Mar 2016 19:12:27 +0000 (15:12 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
13 files changed:
src/librbd/Journal.h
src/librbd/Makefile.am
src/librbd/journal/TypeTraits.h [new file with mode: 0644]
src/test/librbd/test_mock_Journal.cc
src/test/rbd_mirror/mock/MockJournaler.h
src/test/rbd_mirror/test_ImageSync.cc
src/tools/rbd_mirror/ImageSync.h
src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc
src/tools/rbd_mirror/image_replayer/BootstrapRequest.h
src/tools/rbd_mirror/image_sync/ImageCopyRequest.h
src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h
src/tools/rbd_mirror/image_sync/SyncPointCreateRequest.h
src/tools/rbd_mirror/image_sync/SyncPointPruneRequest.h

index 065b202f2246961fdd883146a09b47da2ecb9949..fe9ccf9ae3ffcf15ae2b92e14e4996956aee9903 100644 (file)
@@ -14,6 +14,7 @@
 #include "journal/ReplayEntry.h"
 #include "journal/ReplayHandler.h"
 #include "librbd/journal/Types.h"
+#include "librbd/journal/TypeTraits.h"
 #include <algorithm>
 #include <iosfwd>
 #include <list>
@@ -33,19 +34,7 @@ class AioCompletion;
 class AioObjectRequest;
 class ImageCtx;
 
-namespace journal {
-
-template <typename> class Replay;
-
-template <typename ImageCtxT>
-struct TypeTraits {
-  typedef ::journal::Journaler Journaler;
-  typedef ::journal::Future Future;
-  typedef ::journal::ReplayEntry ReplayEntry;
-};
-
-} // namespace journal
-
+namespace journal { template <typename> class Replay; }
 
 template <typename ImageCtxT = ImageCtx>
 class Journal {
index 2cc5fdf3bc7955c2a4cadd93d893788386d788d6..141135e2f0f6dc755df60ab26d164a1efcbb61f0 100644 (file)
@@ -120,6 +120,7 @@ noinst_HEADERS += \
        librbd/image_watcher/NotifyLockOwner.h \
        librbd/journal/Replay.h \
        librbd/journal/Types.h \
+       librbd/journal/TypeTraits.h \
        librbd/object_map/InvalidateRequest.h \
        librbd/object_map/LockRequest.h \
        librbd/object_map/Request.h \
diff --git a/src/librbd/journal/TypeTraits.h b/src/librbd/journal/TypeTraits.h
new file mode 100644 (file)
index 0000000..d6dde69
--- /dev/null
@@ -0,0 +1,26 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#ifndef CEPH_LIBRBD_JOURNAL_TYPE_TRAITS_H
+#define CEPH_LIBRBD_JOURNAL_TYPE_TRAITS_H
+
+namespace journal {
+class Future;
+class Journaler;
+class ReplayEntry;
+}
+
+namespace librbd {
+namespace journal {
+
+template <typename ImageCtxT>
+struct TypeTraits {
+  typedef ::journal::Journaler Journaler;
+  typedef ::journal::Future Future;
+  typedef ::journal::ReplayEntry ReplayEntry;
+};
+
+} // namespace journal
+} // namespace librbd
+
+#endif // CEPH_LIBRBD_JOURNAL_TYPE_TRAITS_H
index 050a4d06a89adddf74848d0c908db2598ba74024..881ac16573fb048c5631877ae7f0e89454971b3d 100644 (file)
@@ -12,6 +12,7 @@
 #include "librbd/Utils.h"
 #include "librbd/journal/Replay.h"
 #include "librbd/journal/Types.h"
+#include "librbd/journal/TypeTraits.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include <functional>
index 5613eda3bd48b3e627ff22e3691a07593199756d..3b09d9a362b5d8cc2bb62baba736800d986343e3 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <gmock/gmock.h>
 #include "librbd/Journal.h"
+#include "librbd/journal/TypeTraits.h"
 
 namespace journal {
 
index 10622a15856f6139aa19b85ba06ac3ff1a3fe652..e9b234e7db94dde00867f1293c1dd2f2cb13d9e5 100644 (file)
@@ -8,6 +8,7 @@
 #include "librbd/ExclusiveLock.h"
 #include "librbd/ImageCtx.h"
 #include "librbd/ImageState.h"
+#include "librbd/journal/Types.h"
 #include "tools/rbd_mirror/ImageSync.h"
 #include "tools/rbd_mirror/Threads.h"
 
index 175cb7804128f752da325bd7f99b74f4a955d8fc..a9e0d517e7a8c0b6255106d519ea176b6605058b 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "include/int_types.h"
 #include "librbd/ImageCtx.h"
-#include "librbd/Journal.h"
+#include "librbd/journal/TypeTraits.h"
 #include "common/Mutex.h"
 #include <map>
 #include <vector>
index 4260c02f0a612f8c73251a41e839255df56644e8..267de3850a468a61ec1b6af5723516f92c63873d 100644 (file)
@@ -12,6 +12,7 @@
 #include "librbd/ImageCtx.h"
 #include "librbd/ImageState.h"
 #include "librbd/internal.h"
+#include "librbd/journal/Types.h"
 #include "librbd/Utils.h"
 #include "tools/rbd_mirror/ImageSync.h"
 
index 24c68669f7bf7f36eaa96bd0f673140506c8842f..12fffb7e9c36a5774fc5e25b6f786623f14ac800 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "include/int_types.h"
 #include "include/rados/librados.hpp"
-#include "librbd/Journal.h"
+#include "librbd/journal/TypeTraits.h"
 #include <string>
 
 class Context;
@@ -15,6 +15,7 @@ class Mutex;
 class SafeTimer;
 namespace journal { class Journaler; }
 namespace librbd { class ImageCtx; }
+namespace librbd { namespace journal { struct MirrorPeerClientMeta; } }
 
 namespace rbd {
 namespace mirror {
index f2d1396f20bd68ad97965febfb009058b4536418..0d1f5e3170aedfed3abd48eff4c793356ebe62b4 100644 (file)
@@ -7,12 +7,13 @@
 #include "include/int_types.h"
 #include "include/rados/librados.hpp"
 #include "common/Mutex.h"
-#include "librbd/Journal.h"
 #include "librbd/journal/Types.h"
+#include "librbd/journal/TypeTraits.h"
 #include <map>
 #include <vector>
 
 class Context;
+class SafeTimer;
 namespace journal { class Journaler; }
 namespace librbd { struct ImageCtx; }
 
index 44368f23d562b8d8a53d6bbebe7c9d601fccdaf4..b94612b986449392499381c65908eb6e5feac4ec 100644 (file)
@@ -8,7 +8,7 @@
 #include "include/rados/librados.hpp"
 #include "common/snap_types.h"
 #include "librbd/ImageCtx.h"
-#include "librbd/Journal.h"
+#include "librbd/journal/TypeTraits.h"
 #include <map>
 #include <set>
 #include <string>
index ce09eda0db74e21ff138aec201b7355ac47eb42e..0aef0f8de648b6670c2f958dc7a5ac1d0193d3f9 100644 (file)
@@ -4,8 +4,8 @@
 #ifndef RBD_MIRROR_IMAGE_SYNC_SYNC_POINT_CREATE_REQUEST_H
 #define RBD_MIRROR_IMAGE_SYNC_SYNC_POINT_CREATE_REQUEST_H
 
-#include "librbd/Journal.h"
 #include "librbd/journal/Types.h"
+#include "librbd/journal/TypeTraits.h"
 #include <string>
 
 class Context;
index b643fbb20e756f68082dd82e649ba9bca51053b3..3ef4ab62aee308d9f5897eb71d65f994a0a0bc09 100644 (file)
@@ -4,8 +4,8 @@
 #ifndef RBD_MIRROR_IMAGE_SYNC_SYNC_POINT_PRUNE_REQUEST_H
 #define RBD_MIRROR_IMAGE_SYNC_SYNC_POINT_PRUNE_REQUEST_H
 
-#include "librbd/Journal.h"
 #include "librbd/journal/Types.h"
+#include "librbd/journal/TypeTraits.h"
 #include <list>
 #include <string>