diff options
author | shawn <cxwshawn@gmail.com> | 2016-06-17 07:45:58 +0200 |
---|---|---|
committer | shawn <cxwshawn@gmail.com> | 2016-06-22 08:12:12 +0200 |
commit | 2185a6275c89d9462611e965da407ea0d504987d (patch) | |
tree | f98eb49e8c1e2ccd1be8d1d2a9f04afbbbd33737 /src | |
parent | librbd: optimize operation header file dependency (diff) | |
download | ceph-2185a6275c89d9462611e965da407ea0d504987d.tar.xz ceph-2185a6275c89d9462611e965da407ea0d504987d.zip |
librbd: optimize header file dependency & modify related file.
Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
Diffstat (limited to 'src')
31 files changed, 28 insertions, 64 deletions
diff --git a/src/common/event_socket.h b/src/common/event_socket.h index 93e5ed78839..1f1f2c2d10b 100644 --- a/src/common/event_socket.h +++ b/src/common/event_socket.h @@ -18,6 +18,7 @@ #define CEPH_COMMON_EVENT_SOCKET_H #include "include/event_type.h" +#include <unistd.h> class EventSocket { int socket; diff --git a/src/librbd/AioImageRequest.cc b/src/librbd/AioImageRequest.cc index 3b2868801da..ca2a9382394 100644 --- a/src/librbd/AioImageRequest.cc +++ b/src/librbd/AioImageRequest.cc @@ -4,10 +4,7 @@ #include "librbd/AioImageRequest.h" #include "librbd/AioCompletion.h" #include "librbd/AioObjectRequest.h" -#include "librbd/ExclusiveLock.h" #include "librbd/ImageCtx.h" -#include "librbd/ImageState.h" -#include "librbd/ImageWatcher.h" #include "librbd/internal.h" #include "librbd/Journal.h" #include "librbd/journal/Types.h" diff --git a/src/librbd/AioImageRequest.h b/src/librbd/AioImageRequest.h index b30cc30f417..c3987a87310 100644 --- a/src/librbd/AioImageRequest.h +++ b/src/librbd/AioImageRequest.h @@ -17,6 +17,7 @@ namespace librbd { class AioObjectRequest; class ImageCtx; +class AioCompletion; template <typename ImageCtxT = ImageCtx> class AioImageRequest { diff --git a/src/librbd/AioImageRequestWQ.h b/src/librbd/AioImageRequestWQ.h index 74b8438e725..42817c0d799 100644 --- a/src/librbd/AioImageRequestWQ.h +++ b/src/librbd/AioImageRequestWQ.h @@ -6,7 +6,6 @@ #include "include/Context.h" #include "include/atomic.h" -#include "common/Cond.h" #include "common/RWLock.h" #include "common/WorkQueue.h" #include <list> diff --git a/src/librbd/AioObjectRequest.cc b/src/librbd/AioObjectRequest.cc index faee3d2ff9e..dab99030a5b 100644 --- a/src/librbd/AioObjectRequest.cc +++ b/src/librbd/AioObjectRequest.cc @@ -7,6 +7,7 @@ #include "common/Mutex.h" #include "common/RWLock.h" #include "common/WorkQueue.h" +#include "include/Context.h" #include "librbd/AioObjectRequest.h" #include "librbd/AioCompletion.h" @@ -14,8 +15,6 @@ #include "librbd/CopyupRequest.h" #include "librbd/ExclusiveLock.h" #include "librbd/ImageCtx.h" -#include "librbd/ImageWatcher.h" -#include "librbd/internal.h" #include "librbd/ObjectMap.h" #include "librbd/Utils.h" diff --git a/src/librbd/AioObjectRequest.h b/src/librbd/AioObjectRequest.h index 2e9226e9a21..9647a3e6986 100644 --- a/src/librbd/AioObjectRequest.h +++ b/src/librbd/AioObjectRequest.h @@ -9,11 +9,11 @@ #include "common/snap_types.h" #include "include/buffer.h" -#include "include/Context.h" #include "include/rados/librados.hpp" -#include "include/rbd/librbd.hpp" #include "librbd/ObjectMap.h" +class Context; + namespace librbd { struct AioCompletion; diff --git a/src/librbd/AsyncObjectThrottle.cc b/src/librbd/AsyncObjectThrottle.cc index 3bf195c9c44..99f0bfda3e7 100644 --- a/src/librbd/AsyncObjectThrottle.cc +++ b/src/librbd/AsyncObjectThrottle.cc @@ -1,12 +1,10 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include "librbd/AsyncObjectThrottle.h" -#include "include/rbd/librbd.hpp" #include "common/RWLock.h" #include "common/WorkQueue.h" #include "librbd/AsyncRequest.h" #include "librbd/ImageCtx.h" -#include "librbd/internal.h" #include "librbd/Utils.h" namespace librbd diff --git a/src/librbd/AsyncObjectThrottle.h b/src/librbd/AsyncObjectThrottle.h index 08f0199b5ef..845e4875799 100644 --- a/src/librbd/AsyncObjectThrottle.h +++ b/src/librbd/AsyncObjectThrottle.h @@ -5,10 +5,8 @@ #include "include/int_types.h" #include "include/Context.h" -#include "common/RWLock.h" #include <boost/function.hpp> -#include "include/assert.h" namespace librbd { diff --git a/src/librbd/AsyncRequest.cc b/src/librbd/AsyncRequest.cc index a93eb502a21..c251143ba86 100644 --- a/src/librbd/AsyncRequest.cc +++ b/src/librbd/AsyncRequest.cc @@ -2,10 +2,8 @@ // vim: ts=8 sw=2 smarttab #include "librbd/AsyncRequest.h" #include "librbd/ImageCtx.h" -#include "librbd/internal.h" #include "librbd/Utils.h" #include "common/WorkQueue.h" -#include <boost/bind.hpp> namespace librbd { diff --git a/src/librbd/AsyncRequest.h b/src/librbd/AsyncRequest.h index 8ca84f534c8..a2a94735d70 100644 --- a/src/librbd/AsyncRequest.h +++ b/src/librbd/AsyncRequest.h @@ -3,7 +3,6 @@ #ifndef CEPH_LIBRBD_ASYNC_REQUEST_H #define CEPH_LIBRBD_ASYNC_REQUEST_H -#include "include/int_types.h" #include "include/Context.h" #include "include/rados/librados.hpp" #include "include/xlist.h" diff --git a/src/librbd/CopyupRequest.cc b/src/librbd/CopyupRequest.cc index 29d8a4ac40f..484aea8ae2f 100644 --- a/src/librbd/CopyupRequest.cc +++ b/src/librbd/CopyupRequest.cc @@ -13,8 +13,6 @@ #include "librbd/CopyupRequest.h" #include "librbd/ExclusiveLock.h" #include "librbd/ImageCtx.h" -#include "librbd/ImageWatcher.h" -#include "librbd/internal.h" #include "librbd/ObjectMap.h" #include "librbd/Utils.h" diff --git a/src/librbd/CopyupRequest.h b/src/librbd/CopyupRequest.h index 4d971d84795..81cdc5b117a 100644 --- a/src/librbd/CopyupRequest.h +++ b/src/librbd/CopyupRequest.h @@ -5,10 +5,7 @@ #include "librbd/AsyncOperation.h" #include "include/int_types.h" - -#include "common/Mutex.h" #include "include/buffer.h" -#include "include/rados/librados.hpp" namespace librbd { diff --git a/src/librbd/DiffIterate.cc b/src/librbd/DiffIterate.cc index df8287d5c71..9b0a3ac3daa 100644 --- a/src/librbd/DiffIterate.cc +++ b/src/librbd/DiffIterate.cc @@ -3,13 +3,11 @@ #include "librbd/DiffIterate.h" #include "librbd/ImageCtx.h" -#include "librbd/internal.h" #include "librbd/ObjectMap.h" #include "librbd/Utils.h" #include "include/rados/librados.hpp" #include "include/interval_set.h" #include "common/errno.h" -#include "common/Mutex.h" #include "common/Throttle.h" #include "librados/snap_set_diff.h" #include <boost/tuple/tuple.hpp> diff --git a/src/librbd/ExclusiveLock.h b/src/librbd/ExclusiveLock.h index 6268c8080be..43f1e59e14f 100644 --- a/src/librbd/ExclusiveLock.h +++ b/src/librbd/ExclusiveLock.h @@ -8,7 +8,6 @@ #include "include/Context.h" #include "include/rados/librados.hpp" #include "common/Mutex.h" -#include "common/RWLock.h" #include <list> #include <string> #include <utility> diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 564996985f9..b7a9fd70733 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -27,6 +27,7 @@ #include "librbd/Operations.h" #include "librbd/operation/ResizeRequest.h" #include "librbd/Utils.h" +#include "librbd/LibrbdWriteback.h" #include "osdc/Striper.h" #include <boost/bind.hpp> diff --git a/src/librbd/ImageCtx.h b/src/librbd/ImageCtx.h index 076072c7a01..2174392f00f 100644 --- a/src/librbd/ImageCtx.h +++ b/src/librbd/ImageCtx.h @@ -7,18 +7,15 @@ #include <list> #include <map> -#include <set> #include <string> #include <vector> -#include <boost/optional.hpp> -#include "common/Cond.h" #include "common/event_socket.h" #include "common/Mutex.h" #include "common/Readahead.h" #include "common/RWLock.h" #include "common/snap_types.h" -#include "include/atomic.h" + #include "include/buffer_fwd.h" #include "include/rbd/librbd.hpp" #include "include/rbd_types.h" @@ -28,7 +25,6 @@ #include "cls/rbd/cls_rbd_client.h" #include "librbd/AsyncRequest.h" -#include "librbd/LibrbdWriteback.h" #include "librbd/SnapInfo.h" #include "librbd/parent_types.h" @@ -51,6 +47,7 @@ namespace librbd { class LibrbdAdminSocketHook; class ObjectMap; template <typename> class Operations; + class LibrbdWriteback; namespace exclusive_lock { struct Policy; } namespace journal { struct Policy; } diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index d3d4e701a73..70e5fafdf95 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -7,7 +7,6 @@ #include "librbd/ImageCtx.h" #include "librbd/ImageState.h" #include "librbd/internal.h" -#include "librbd/ObjectMap.h" #include "librbd/Operations.h" #include "librbd/TaskFinisher.h" #include "librbd/Utils.h" @@ -15,13 +14,9 @@ #include "librbd/image_watcher/Notifier.h" #include "librbd/image_watcher/NotifyLockOwner.h" #include "include/encoding.h" -#include "include/stringify.h" #include "common/errno.h" #include "common/WorkQueue.h" -#include <sstream> #include <boost/bind.hpp> -#include <boost/function.hpp> -#include <boost/scope_exit.hpp> #define dout_subsys ceph_subsys_rbd #undef dout_prefix diff --git a/src/librbd/ImageWatcher.h b/src/librbd/ImageWatcher.h index da1c11b332b..3bb3fba60d8 100644 --- a/src/librbd/ImageWatcher.h +++ b/src/librbd/ImageWatcher.h @@ -7,16 +7,13 @@ #include "common/Mutex.h" #include "common/RWLock.h" #include "include/Context.h" -#include "include/rados/librados.hpp" #include "include/rbd/librbd.hpp" #include "librbd/image_watcher/Notifier.h" #include "librbd/WatchNotifyTypes.h" #include <set> #include <string> #include <utility> -#include <vector> -#include <boost/function.hpp> -#include "include/assert.h" +#include <boost/variant.hpp> class entity_name_t; diff --git a/src/librbd/Journal.cc b/src/librbd/Journal.cc index b874005843e..4c9869d0780 100644 --- a/src/librbd/Journal.cc +++ b/src/librbd/Journal.cc @@ -14,6 +14,8 @@ #include "common/errno.h" #include "common/Timer.h" #include "common/WorkQueue.h" +#include "include/rados/librados.hpp" + #include <boost/scope_exit.hpp> #define dout_subsys ceph_subsys_rbd diff --git a/src/librbd/Journal.h b/src/librbd/Journal.h index d77d50ed286..9d51a45e6d6 100644 --- a/src/librbd/Journal.h +++ b/src/librbd/Journal.h @@ -8,7 +8,6 @@ #include "include/atomic.h" #include "include/Context.h" #include "include/interval_set.h" -#include "include/rados/librados.hpp" #include "common/Mutex.h" #include "journal/Future.h" #include "journal/ReplayEntry.h" @@ -16,17 +15,18 @@ #include "librbd/journal/Types.h" #include "librbd/journal/TypeTraits.h" #include <algorithm> -#include <iosfwd> #include <list> #include <string> #include <unordered_map> -class Context; class ContextWQ; class SafeTimer; namespace journal { class Journaler; } +namespace librados { + class IoCtx; +} namespace librbd { diff --git a/src/librbd/LibrbdWriteback.h b/src/librbd/LibrbdWriteback.h index ef5fa75127b..a7dc05f9c13 100644 --- a/src/librbd/LibrbdWriteback.h +++ b/src/librbd/LibrbdWriteback.h @@ -5,13 +5,12 @@ #include <queue> -#include "include/Context.h" -#include "include/types.h" -#include "include/rados/librados.hpp" +#include "common/snap_types.h" #include "osd/osd_types.h" #include "osdc/WritebackHandler.h" class Mutex; +class Context; namespace librbd { diff --git a/src/librbd/MirroringWatcher.cc b/src/librbd/MirroringWatcher.cc index c414478fe32..a6f0a20dc31 100644 --- a/src/librbd/MirroringWatcher.cc +++ b/src/librbd/MirroringWatcher.cc @@ -3,6 +3,7 @@ #include "librbd/MirroringWatcher.h" #include "include/rbd_types.h" +#include "include/rados/librados.hpp" #include "common/errno.h" #define dout_subsys ceph_subsys_rbd diff --git a/src/librbd/MirroringWatcher.h b/src/librbd/MirroringWatcher.h index f2ec61a6730..21285565d22 100644 --- a/src/librbd/MirroringWatcher.h +++ b/src/librbd/MirroringWatcher.h @@ -5,12 +5,15 @@ #define CEPH_LIBRBD_MIRRORING_WATCHER_H #include "include/int_types.h" -#include "include/rados/librados.hpp" #include "cls/rbd/cls_rbd_types.h" #include "librbd/ImageCtx.h" #include "librbd/ObjectWatcher.h" #include "librbd/mirroring_watcher/Types.h" +namespace librados { + class IoCtx; +} + namespace librbd { template <typename ImageCtxT = librbd::ImageCtx> diff --git a/src/librbd/ObjectMap.cc b/src/librbd/ObjectMap.cc index 9f7d1d4a45c..8b567861bcf 100644 --- a/src/librbd/ObjectMap.cc +++ b/src/librbd/ObjectMap.cc @@ -3,9 +3,6 @@ #include "librbd/ObjectMap.h" #include "librbd/ExclusiveLock.h" #include "librbd/ImageCtx.h" -#include "librbd/ImageWatcher.h" -#include "librbd/internal.h" -#include "librbd/object_map/InvalidateRequest.h" #include "librbd/object_map/RefreshRequest.h" #include "librbd/object_map/ResizeRequest.h" #include "librbd/object_map/SnapshotCreateRequest.h" @@ -17,6 +14,9 @@ #include "common/dout.h" #include "common/errno.h" #include "common/WorkQueue.h" + +#include "include/rados/librados.hpp" + #include "cls/lock/cls_lock_client.h" #include "cls/rbd/cls_rbd_types.h" #include "include/stringify.h" diff --git a/src/librbd/ObjectMap.h b/src/librbd/ObjectMap.h index f2852961aa3..a13166066ff 100644 --- a/src/librbd/ObjectMap.h +++ b/src/librbd/ObjectMap.h @@ -5,13 +5,15 @@ #include "include/int_types.h" #include "include/fs_types.h" -#include "include/rados/librados.hpp" #include "include/rbd/object_map_types.h" #include "common/bit_vector.hpp" #include <boost/optional.hpp> class Context; class RWLock; +namespace librados { + class IoCtx; +} namespace librbd { diff --git a/src/librbd/Operations.cc b/src/librbd/Operations.cc index f19ebf2b891..622a8a60549 100644 --- a/src/librbd/Operations.cc +++ b/src/librbd/Operations.cc @@ -5,6 +5,7 @@ #include "common/dout.h" #include "common/errno.h" #include "common/WorkQueue.h" + #include "librbd/ExclusiveLock.h" #include "librbd/ImageCtx.h" #include "librbd/ImageState.h" diff --git a/src/librbd/SnapInfo.h b/src/librbd/SnapInfo.h index 4a225a4625f..1babee9e550 100644 --- a/src/librbd/SnapInfo.h +++ b/src/librbd/SnapInfo.h @@ -5,9 +5,6 @@ #include "include/int_types.h" -#include "include/rados/librados.hpp" - -#include "cls/rbd/cls_rbd_client.h" #include "librbd/parent_types.h" namespace librbd { diff --git a/src/librbd/TaskFinisher.h b/src/librbd/TaskFinisher.h index 466537e7273..6761772af7d 100644 --- a/src/librbd/TaskFinisher.h +++ b/src/librbd/TaskFinisher.h @@ -3,7 +3,6 @@ #ifndef LIBRBD_TASK_FINISHER_H #define LIBRBD_TASK_FINISHER_H -#include "include/int_types.h" #include "include/Context.h" #include "common/Finisher.h" #include "common/Mutex.h" @@ -12,7 +11,6 @@ #include <utility> class CephContext; -class Context; namespace librbd { diff --git a/src/librbd/Utils.h b/src/librbd/Utils.h index fd881f67f25..681bb5b16db 100644 --- a/src/librbd/Utils.h +++ b/src/librbd/Utils.h @@ -8,8 +8,6 @@ #include "include/Context.h" #include <type_traits> -class Context; - namespace librbd { class ImageCtx; diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index a73fb720492..0706d2e4518 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -10,9 +10,7 @@ #include "common/ceph_context.h" #include "common/dout.h" #include "common/errno.h" -#include "common/ContextCompletion.h" #include "common/Throttle.h" -#include "common/WorkQueue.h" #include "common/event_socket.h" #include "cls/lock/cls_lock_client.h" #include "include/stringify.h" @@ -26,12 +24,10 @@ #include "librbd/AioImageRequest.h" #include "librbd/AioImageRequestWQ.h" #include "librbd/AioObjectRequest.h" -#include "librbd/CopyupRequest.h" #include "librbd/DiffIterate.h" #include "librbd/ExclusiveLock.h" #include "librbd/ImageCtx.h" #include "librbd/ImageState.h" -#include "librbd/ImageWatcher.h" #include "librbd/internal.h" #include "librbd/Journal.h" #include "librbd/journal/Types.h" @@ -45,7 +41,6 @@ #include "journal/Journaler.h" -#include <boost/bind.hpp> #include <boost/scope_exit.hpp> #include <boost/variant.hpp> #include "include/assert.h" diff --git a/src/librbd/librbd.cc b/src/librbd/librbd.cc index 6711b39db17..f88ff21f624 100644 --- a/src/librbd/librbd.cc +++ b/src/librbd/librbd.cc @@ -15,14 +15,10 @@ #include <errno.h> -#include "common/Cond.h" #include "common/dout.h" #include "common/errno.h" -#include "common/snap_types.h" -#include "common/perf_counters.h" #include "common/TracepointProvider.h" #include "include/Context.h" -#include "osdc/ObjectCacher.h" #include "librbd/AioCompletion.h" #include "librbd/AioImageRequestWQ.h" |