]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: optimize header file dependency & modify related file.
authorshawn <cxwshawn@gmail.com>
Fri, 17 Jun 2016 05:45:58 +0000 (01:45 -0400)
committerMykola Golub <mgolub@mirantis.com>
Fri, 19 Aug 2016 19:59:06 +0000 (22:59 +0300)
Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>
(cherry picked from commit 2185a6275c89d9462611e965da407ea0d504987d)

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 5c6b40bbd81abd3aebb811b2554e2334c6d0dc91..2f3db40e62cc5dc2ba7ee1a5ed08bd2844a2f413 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 01e7689ee9d412c150cd5d897417b30483b5b0c5..1c2a4b140c0f96fc5973f539faf2fb08949aa7f6 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 b95b5f9e741ec1dec2be4eebc2b2b19d0a312c9a..b36c09b27132dc14a5645c2dbd30e184f8b604c6 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 f550b0b49785ec92a1fb2f69d1ebe4fa9deedecd..934375ec04029c69175f407bb6da34a95965fcbc 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 3a1eb00531961d3a3cd6af6a978dfe2d05e898ca..f74368dc644f68325a78aab8eafb3a9eed7c9069 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 4c22f175fc4abaeb2b92d52834c882b0ff007881..da7c43ae286a0fd748b4b46a98f38a903e427214 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 0a2a88e2949681cbf5dcd829bc09870763e07543..f901ea22bd5ceb5b210d1910699f81e7804e4455 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 868a8e3e2b7dd2ca5ca64ff20822efc22e198959..f88d32d63b56334550f3b9c59fbb6ad3c8d8d8e1 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 3bd08966963eafea2d077c8420956277b32262c5..709987f7a33d6e93643de33f6582c812aa4394e0 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 09b0195b2294daa75ccb0bdcfdd0c353c3081ca2..78e2585ca302653f1fc47d68e1975051d996f83d 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 0ae5245a239084604ccf45013a649df3789546ed..5182a972772d314d51271b1656d46598cde8c471 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 fe37fa1e87748df9b5b03b808db7dbaa65115ad5..671553f5b830d2f31e8c16db911540d89831b69c 100644 (file)
@@ -15,6 +15,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 76671ff8ba03605a2104ac958e13a634a83ab358..496c8819f963675c766696f46d48d0fcab25cdcb 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/JournalMetadataListener.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 ffdb90be55d401ffd612977984817dbf46522685..b5d659ef8a2e8aa9ba2880171dcf0a3f07fc13d7 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 ef4b3bee5c37722b5f815e65f74009402007992f..5d99180e771a3e930baa02a2c5075af2c3049b5e 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 6c9d9e72581a041d73dbfee97bf013d92a2f078c..90bc53a96582cc9d1fd8415302f231b50e771f9e 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 f54681f4bb96e68190bb6fd0b7413fb2f519b6f1..e0aebd965f47fae1f5faa05e32db97170641a06c 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 68fd94a6edffcadb26d0905998a9d0a194f09c48..799bf0f8d3994c81079af1c3b653319bcb3ced1a 100644 (file)
@@ -8,8 +8,6 @@
 #include "include/Context.h"
 #include <type_traits>
 
-class Context;
-
 namespace librbd {
 
 class ImageCtx;
index e726b9ef53667af11fd4030ebde7f727849babfa..a3b5ee20ff8c63f9900fdf52da2ce8a5fca951a8 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 71e031f86aa865cddc52912ab7907131ce74be82..b71d5e8c3f6461216ce33099154f5f9eb4ab2edc 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"