From: Jason Dillaman Date: Mon, 21 Mar 2016 20:52:07 +0000 (-0400) Subject: librbd: journal type traits should be standalone X-Git-Tag: v10.1.1~64^2~34 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dae789dd2bb505dc99338b5d773964e1d500e715;p=ceph.git librbd: journal type traits should be standalone Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/Journal.h b/src/librbd/Journal.h index 065b202f2246..fe9ccf9ae3ff 100644 --- a/src/librbd/Journal.h +++ b/src/librbd/Journal.h @@ -14,6 +14,7 @@ #include "journal/ReplayEntry.h" #include "journal/ReplayHandler.h" #include "librbd/journal/Types.h" +#include "librbd/journal/TypeTraits.h" #include #include #include @@ -33,19 +34,7 @@ class AioCompletion; class AioObjectRequest; class ImageCtx; -namespace journal { - -template class Replay; - -template -struct TypeTraits { - typedef ::journal::Journaler Journaler; - typedef ::journal::Future Future; - typedef ::journal::ReplayEntry ReplayEntry; -}; - -} // namespace journal - +namespace journal { template class Replay; } template class Journal { diff --git a/src/librbd/Makefile.am b/src/librbd/Makefile.am index 2cc5fdf3bc79..141135e2f0f6 100644 --- a/src/librbd/Makefile.am +++ b/src/librbd/Makefile.am @@ -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 index 000000000000..d6dde690d856 --- /dev/null +++ b/src/librbd/journal/TypeTraits.h @@ -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 +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 diff --git a/src/test/librbd/test_mock_Journal.cc b/src/test/librbd/test_mock_Journal.cc index 050a4d06a89a..881ac16573fb 100644 --- a/src/test/librbd/test_mock_Journal.cc +++ b/src/test/librbd/test_mock_Journal.cc @@ -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 diff --git a/src/test/rbd_mirror/mock/MockJournaler.h b/src/test/rbd_mirror/mock/MockJournaler.h index 5613eda3bd48..3b09d9a362b5 100644 --- a/src/test/rbd_mirror/mock/MockJournaler.h +++ b/src/test/rbd_mirror/mock/MockJournaler.h @@ -6,6 +6,7 @@ #include #include "librbd/Journal.h" +#include "librbd/journal/TypeTraits.h" namespace journal { diff --git a/src/test/rbd_mirror/test_ImageSync.cc b/src/test/rbd_mirror/test_ImageSync.cc index 10622a15856f..e9b234e7db94 100644 --- a/src/test/rbd_mirror/test_ImageSync.cc +++ b/src/test/rbd_mirror/test_ImageSync.cc @@ -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" diff --git a/src/tools/rbd_mirror/ImageSync.h b/src/tools/rbd_mirror/ImageSync.h index 175cb7804128..a9e0d517e7a8 100644 --- a/src/tools/rbd_mirror/ImageSync.h +++ b/src/tools/rbd_mirror/ImageSync.h @@ -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 #include diff --git a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc index 4260c02f0a61..267de3850a46 100644 --- a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.cc @@ -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" diff --git a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h index 24c68669f7bf..12fffb7e9c36 100644 --- a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h +++ b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h @@ -6,7 +6,7 @@ #include "include/int_types.h" #include "include/rados/librados.hpp" -#include "librbd/Journal.h" +#include "librbd/journal/TypeTraits.h" #include 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 { diff --git a/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h b/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h index f2d1396f20bd..0d1f5e3170ae 100644 --- a/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h +++ b/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h @@ -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 #include class Context; +class SafeTimer; namespace journal { class Journaler; } namespace librbd { struct ImageCtx; } diff --git a/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h b/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h index 44368f23d562..b94612b98644 100644 --- a/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h +++ b/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h @@ -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 #include #include diff --git a/src/tools/rbd_mirror/image_sync/SyncPointCreateRequest.h b/src/tools/rbd_mirror/image_sync/SyncPointCreateRequest.h index ce09eda0db74..0aef0f8de648 100644 --- a/src/tools/rbd_mirror/image_sync/SyncPointCreateRequest.h +++ b/src/tools/rbd_mirror/image_sync/SyncPointCreateRequest.h @@ -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 class Context; diff --git a/src/tools/rbd_mirror/image_sync/SyncPointPruneRequest.h b/src/tools/rbd_mirror/image_sync/SyncPointPruneRequest.h index b643fbb20e75..3ef4ab62aee3 100644 --- a/src/tools/rbd_mirror/image_sync/SyncPointPruneRequest.h +++ b/src/tools/rbd_mirror/image_sync/SyncPointPruneRequest.h @@ -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 #include