]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: optimize header file dependency & modify related file. 9539/head
authorshawn <cxwshawn@gmail.com>
Fri, 17 Jun 2016 05:45:58 +0000 (01:45 -0400)
committershawn <cxwshawn@gmail.com>
Wed, 22 Jun 2016 06:12:12 +0000 (02:12 -0400)
Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
31 files changed:
src/common/event_socket.h
src/librbd/AioImageRequest.cc
src/librbd/AioImageRequest.h
src/librbd/AioImageRequestWQ.h
src/librbd/AioObjectRequest.cc
src/librbd/AioObjectRequest.h
src/librbd/AsyncObjectThrottle.cc
src/librbd/AsyncObjectThrottle.h
src/librbd/AsyncRequest.cc
src/librbd/AsyncRequest.h
src/librbd/CopyupRequest.cc
src/librbd/CopyupRequest.h
src/librbd/DiffIterate.cc
src/librbd/ExclusiveLock.h
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/ImageWatcher.cc
src/librbd/ImageWatcher.h
src/librbd/Journal.cc
src/librbd/Journal.h
src/librbd/LibrbdWriteback.h
src/librbd/MirroringWatcher.cc
src/librbd/MirroringWatcher.h
src/librbd/ObjectMap.cc
src/librbd/ObjectMap.h
src/librbd/Operations.cc
src/librbd/SnapInfo.h
src/librbd/TaskFinisher.h
src/librbd/Utils.h
src/librbd/internal.cc
src/librbd/librbd.cc

index 93e5ed78839b20aa2a3e22f33970114545d6365c..1f1f2c2d10bf96560040095f11b8a68800fe87ef 100644 (file)
@@ -18,6 +18,7 @@
 #define CEPH_COMMON_EVENT_SOCKET_H
 
 #include "include/event_type.h"
+#include <unistd.h>
 
 class EventSocket {
   int socket;
index 3b2868801da18b8bcba6653a33acf405b3351878..ca2a93823945e71a105dda96f0a1aaaf82286a60 100644 (file)
@@ -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"
index b30cc30f417a77e6470972ad1457ddc977f17187..c3987a873105e77b95dc1d315513f8e7ea2a981b 100644 (file)
@@ -17,6 +17,7 @@ namespace librbd {
 
 class AioObjectRequest;
 class ImageCtx;
+class AioCompletion;
 
 template <typename ImageCtxT = ImageCtx>
 class AioImageRequest {
index 74b8438e7253ad84ea2cb28612f5a997f1d4cd65..42817c0d799cee56b640c219e0e396982f7bcb26 100644 (file)
@@ -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>
index faee3d2ff9ea99a3bebbe1d17d5033e90cd349ee..dab99030a5b7570e8ef4b6036364fa8c6e50c46b 100644 (file)
@@ -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"
 
index 2e9226e9a2108229a60fba5b2e43e1bf71aaf021..9647a3e698661597cb6d739daac7d14dbbd8c375 100644 (file)
@@ -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;
index 3bf195c9c449a8ff830cb9e73e683a5ca1469358..99f0bfda3e7e88051450e34b73423bc90b1ebdc6 100644 (file)
@@ -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
index 08f0199b5efb916cba8e86a830d6e5e57447a87e..845e487579972b65e90f6ae89c643ff5d3ef5137 100644 (file)
@@ -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
 {
index a93eb502a21cad8a84c729ac4019af6780b6bc19..c251143ba86ac0d37b5acd2b88d46255e0891c6b 100644 (file)
@@ -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
 {
index 8ca84f534c8f7f138aac6b9a63855742c41d7874..a2a94735d70a9a73b3e09fd6229b573c077bc18b 100644 (file)
@@ -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"
index 29d8a4ac40fb5a9c1da30adbf21217c6f8fe4440..484aea8ae2f2ba31c6fdcf7a34218be015241065 100644 (file)
@@ -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"
 
index 4d971d847952f7ed3cd3aba7c344f6a0cd67be1f..81cdc5b117ad1e4b219e4ccde64c1a4234603888 100644 (file)
@@ -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 {
 
index df8287d5c7181274502ef7b4b539827ca9a3526d..9b0a3ac3daa86f8765406ef5cda287e623023c62 100644 (file)
@@ -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>
index 6268c8080be11af3366e18c760f107442fe4013f..43f1e59e14f54ffc1d71b4e24ca0a0e7d92a490c 100644 (file)
@@ -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>
index 564996985f9c63a10dc7edac464939d9befc63fd..b7a9fd70733b7f50ce9f71e59d94f652b753438a 100644 (file)
@@ -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>
index 076072c7a01879e3861194c9fe0ff056425f4dbb..2174392f00f6e942256d2cf23ae7a77044747baa 100644 (file)
@@ -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; }
index d3d4e701a736ee92c2c7e7192c62b337910e34b2..70e5fafdf959151c8dce26a385f0ec4ecdc15adc 100644 (file)
@@ -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"
 #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
index da1c11b332b5b4baff3c91e994897964c8ef804f..3bb3fba60d863dc9119a43d96603881354311195 100644 (file)
@@ -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;
 
index b874005843ee7e080eda4adac50a1a7b34916c34..4c9869d0780fe7a1adcdfac7aff677d9403ae43e 100644 (file)
@@ -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
index d77d50ed286806be39f3c110499b0c0ffed803fe..9d51a45e6d641347bec00fd58a5480567ae79313 100644 (file)
@@ -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"
 #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 {
 
index ef5fa75127b89b3b181a1721975b5e222abf0de3..a7dc05f9c1343240590d774360aa7b8cc1599506 100644 (file)
@@ -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 {
 
index c414478fe32aabb609abd82bcf4e7394b9bf9edc..a6f0a20dc315b49ad6f5dab912a314fa3390b46f 100644 (file)
@@ -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
index f2ec61a6730aa5eb1c2f6016cb45a5de53a757b5..21285565d229cfded392facc0bc0ff14ce316eb7 100644 (file)
@@ -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>
index 9f7d1d4a45cf3fc22cefb59d8febc67e2240c1b9..8b567861bcf3c801f37d6f4c95e3f82b127e3cbd 100644 (file)
@@ -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"
index f2852961aa38edc819596e0cd1e08b8de9bc6eaf..a13166066ff1633b17a05716e23e99394e22c717 100644 (file)
@@ -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 {
 
index f19ebf2b891146a1575ae86f3e60137e000d8fe2..622a8a605494aeb07bac29215bb02b79d250d485 100644 (file)
@@ -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"
index 4a225a4625f7a539a03affc87c12e6e3d420293c..1babee9e550f282dceb4c9aefa073a3fe5800bd7 100644 (file)
@@ -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 {
index 466537e727375a4d79eee5845fe353b89600dbd3..6761772af7d196929c78d23ddcb7f83b54fa6ea5 100644 (file)
@@ -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 {
 
index fd881f67f25e17d8c8b2f359689f3f7523fa5e87..681bb5b16dbfe37d69d862fa07dd0f8fcfa5d871 100644 (file)
@@ -8,8 +8,6 @@
 #include "include/Context.h"
 #include <type_traits>
 
-class Context;
-
 namespace librbd {
 
 class ImageCtx;
index a73fb72049227087b80c63c18e0cec98186ffe71..0706d2e4518ee4200be89d0e216f4660177b369d 100644 (file)
@@ -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"
 #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"
index 6711b39db1702e06bc1e4fcc711ea169a37b95c3..f88ff21f62477ee25ec2527c6ae0db4dace77a74 100644 (file)
 
 #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"