]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/buffer: forward declare buffer 6686/head
authorMichal Jarzabek <stiopa@gmail.com>
Mon, 23 Nov 2015 19:32:55 +0000 (19:32 +0000)
committerMichal Jarzabek <stiopa@gmail.com>
Mon, 30 Nov 2015 19:38:51 +0000 (19:38 +0000)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
39 files changed:
src/cls/journal/cls_journal_types.h
src/cls/rbd/cls_rbd.h
src/common/ConfUtils.h
src/common/Formatter.cc
src/common/Formatter.h
src/common/admin_socket.h
src/common/ceph_context.h
src/common/ceph_crypto_cms.h
src/common/entity_name.h
src/common/perf_counters.h
src/erasure-code/ErasureCode.cc
src/erasure-code/ErasureCodeInterface.h
src/journal/Journaler.h
src/kv/KineticStore.h
src/kv/LevelDBStore.h
src/kv/RocksDBStore.h
src/librbd/AioImageRequest.h
src/librbd/ImageCtx.h
src/librbd/JournalReplay.h
src/librbd/WatchNotifyTypes.h
src/librbd/internal.h
src/mds/CDentry.h
src/mds/CDir.h
src/mds/Capability.h
src/mds/LogEvent.h
src/mds/MDSTable.h
src/os/DBObjectMap.h
src/os/HashIndex.h
src/os/Journal.h
src/os/WBThrottle.h
src/osd/ECUtil.cc
src/osd/ECUtil.h
src/osd/PG.h
src/rbd_replay/ActionTypes.h
src/rbd_replay/ios.hpp
src/test/common/ObjectContents.h
src/test/common/test_tableformatter.cc
src/test/librados_test_stub/TestRadosClient.h
src/tools/rados/RadosImport.h

index dd38b0d34347b41636fe6b4091e6030e71cfec00..934873977ecd3fff71b054d5deac66421ba2f456 100644 (file)
@@ -5,7 +5,7 @@
 #define CEPH_CLS_JOURNAL_TYPES_H
 
 #include "include/int_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/encoding.h"
 #include <iosfwd>
 #include <list>
index 5f79d5a83656969cf4d3058a087753af7299e9f1..710b54213ff85302817a23cb99cf26e31cbcb543 100644 (file)
@@ -4,7 +4,7 @@
 #define __CEPH_CLS_RBD_H
 
 #include "include/types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "common/Formatter.h"
 #include "librbd/parent_types.h"
 
index e816f68c2a8b24a4d9b0e40239a227159d27fab7..7a5b79a047a1ce3094eba11992046d01022c6992 100644 (file)
@@ -20,7 +20,7 @@
 #include <set>
 #include <string>
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 
 /*
  * Ceph configuration file support.
index 7c166ef09865f06b97205ebeed8e1803c0be790a..9b5b20303e85c34534c62eaa9c508cca230a9ed5 100644 (file)
@@ -19,6 +19,7 @@
 #include "assert.h"
 #include "Formatter.h"
 #include "common/escape.h"
+#include "include/buffer.h"
 
 #include <iostream>
 #include <sstream>
@@ -89,6 +90,14 @@ Formatter *Formatter::create(const std::string &type,
     return (Formatter *) NULL;
 }
 
+
+void Formatter::flush(bufferlist &bl)
+{
+  std::stringstream os;
+  flush(os);
+  bl.append(os.str());
+}
+
 void Formatter::dump_format(const char *name, const char *fmt, ...)
 {
   va_list ap;
index 181a0e0a86aee18c9101db7d9a6ee4fe0c461236..3c145c8912b2c9d3e675b1ff2a1ef87e7b54ce26 100644 (file)
@@ -14,7 +14,7 @@
 #include <string>
 #include <map>
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 
 namespace ceph {
 
@@ -41,12 +41,7 @@ namespace ceph {
     virtual ~Formatter();
 
     virtual void flush(std::ostream& os) = 0;
-    void flush(bufferlist &bl)
-    {
-      std::stringstream os;
-      flush(os);
-      bl.append(os.str());
-    }
+    void flush(bufferlist &bl);
     virtual void reset() = 0;
 
     virtual void open_array_section(const char *name) = 0;
index bbbaa2933213bb7a0f18ea6655e16deea840f54c..bad235a277f6eecab49c04a3a6dc7e487dc4a101 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <string>
 #include <map>
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "common/cmdparse.h"
 
 class AdminSocket;
index 3820a2355ead4264c2404e6534a8599cff6ba668..1a6ceafd7fb2efd09611e759221b3d42ef809387 100644 (file)
@@ -21,7 +21,7 @@
 #include <set>
 
 #include "include/assert.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/atomic.h"
 #include "common/cmdparse.h"
 #include "include/Spinlock.h"
index 5b0a7f5950f0642deeba3f2d0010f087073ce9ed..11fb000cae52a1477a554a7c249e1c02ac62738b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CEPH_CRYPTO_CMS_H
 #define CEPH_CRYPTO_CMS_H
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 
 class CephContext;
 
index 2949f1fa648582134dab2d7000e38be58e1b12df..e9329754762c2649f6c1f8decd58c0de2602fd83 100644 (file)
@@ -20,7 +20,7 @@
 #include <string>
 
 #include "include/encoding.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "msg/msg_types.h"
 
 /* Represents a Ceph entity name.
index 34f406768a2b24447d8558d0f20b103cb6aa60c8..74dfa7dab73149189f084c8051b81a382991ac6c 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "common/config_obs.h"
 #include "common/Mutex.h"
-#include "include/buffer.h"
 #include "include/utime.h"
 
 #include <stdint.h>
index d8d54907eb2ec3fa55b0f2ea5353d3e4b3cff7fc..6d83d44385fe77f093b601af1a9d41997987d391 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "common/strtol.h"
 #include "ErasureCode.h"
+#include "include/buffer.h"
 
 const unsigned ErasureCode::SIMD_ALIGN = 32;
 
index 5eb55714120d8bd0e4f47ec5531c3dc2c3a862f4..3ac2b891b26ba7cc7ad7de413501d74b4828050a 100644 (file)
 #include <vector>
 #include <iostream>
 #include "include/memory.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 
 class CrushWrapper;
 
index d35821891402e829202c156a66cf46a9fa675aa3..e43cf1ab9346b4d4ac45d07d5649fc582372db17 100644 (file)
@@ -5,7 +5,7 @@
 #define CEPH_JOURNAL_JOURNALER_H
 
 #include "include/int_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/Context.h"
 #include "include/rados/librados.hpp"
 #include "journal/Future.h"
index 657dfebb451ec34e9181a1d9fda81c4c20861c86..f275b896bfd61fee5da9748bbe7f624b41625004 100644 (file)
@@ -4,7 +4,7 @@
 #define KINETIC_STORE_H
 
 #include "include/types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "KeyValueDB.h"
 #include <set>
 #include <map>
index c2696011bed1f0f28d7d28e52586597411b9956f..2ce421c2fdc5423558ffc8a7ac9fd8274d2f60ce 100644 (file)
@@ -4,7 +4,7 @@
 #define LEVEL_DB_STORE_H
 
 #include "include/types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "KeyValueDB.h"
 #include <set>
 #include <map>
index 90523c451b71ce94594669df7dde611cd56543a3..eb2f157feba31a46f5e5fae9d23043a9456808b7 100644 (file)
@@ -4,7 +4,7 @@
 #define ROCKS_DB_STORE_H
 
 #include "include/types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "KeyValueDB.h"
 #include <set>
 #include <map>
index c6037e67e0140eedf9a382c2e85d71fc1ee47186..9d29956aefe3de608fa0867464e87418ad13999f 100644 (file)
@@ -5,7 +5,7 @@
 #define CEPH_LIBRBD_AIO_IMAGE_REQUEST_H
 
 #include "include/int_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "common/snap_types.h"
 #include "osd/osd_types.h"
 #include "librbd/AioCompletion.h"
index 28e8f7455afbc0e7a519e16053ef6145c131c258..563d08f4b4e46c4ac2f2493610d1a93f75062083 100644 (file)
@@ -17,7 +17,7 @@
 #include "common/RWLock.h"
 #include "common/snap_types.h"
 #include "include/atomic.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/rbd/librbd.hpp"
 #include "include/rbd_types.h"
 #include "include/types.h"
index 62be2dfb36ef85038638b823d5b3c5b614777a77..16532da2cbbb71f13317a84cd95264a12f716909 100644 (file)
@@ -5,7 +5,7 @@
 #define CEPH_LIBRBD_JOURNAL_REPLAY_H
 
 #include "include/int_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/rbd/librbd.hpp"
 #include "common/Cond.h"
 #include "common/Mutex.h"
index 30ab2d016389290719bdd236f1c9d2ab1769ef0a..468b45ab475c318d236c47510129c6e8cbe24467 100644 (file)
@@ -4,7 +4,7 @@
 #define LIBRBD_WATCH_NOTIFY_TYPES_H
 
 #include "include/int_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/encoding.h"
 #include <iosfwd>
 #include <list>
index 04f5a24e87eac351ff913d502f6fd0a8df50531f..67ef2e4fcc1d36e8d2d0aa8e85dc1d7bebacd66d 100644 (file)
@@ -10,7 +10,7 @@
 #include <string>
 #include <vector>
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/rbd/librbd.hpp"
 #include "include/rbd_types.h"
 
index 171fb3b1c0fd8bb935d22fa63bd495baddbded0c..7bf21d629bc56d9f01f674fdee8a2223d41541f7 100644 (file)
@@ -21,7 +21,7 @@
 #include <set>
 
 #include "include/types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/lru.h"
 #include "include/elist.h"
 #include "include/filepath.h"
index e161d5ba9c6dd8e5ac32e7d2ec31a1643019f17a..44034b8d475ffe3cbbe7f6c833c95deba45a9263 100644 (file)
@@ -18,7 +18,7 @@
 #define CEPH_CDIR_H
 
 #include "include/types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "mdstypes.h"
 #include "common/config.h"
 #include "common/DecayCounter.h"
index 55922ab3711ec84389d5e931c4a120d1fe23c994..7f1b5b8d81cca95cceea0e8b732b827946f87059 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef CEPH_CAPABILITY_H
 #define CEPH_CAPABILITY_H
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/xlist.h"
 
 #include "common/config.h"
index b3fabf4ad9e54db70f19683bc78e7fcdb7fa0374..26bf2797a515124e86f6f95a8bd8b648a9ced99d 100644 (file)
@@ -42,7 +42,7 @@
 #define EVENT_NOOP        51
 
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/Context.h"
 #include "include/utime.h"
 
index 3eeb8a2b92d6b4d52faa2046bd2cdf351f44c09a..904ecfd9ea71543be3d04fd040c3ded35c6ac0cc 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "mdstypes.h"
 #include "mds_table_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 
 class MDSRank;
 class Context;
index 00ce46ee8685490d3bac538de17d7e0fcccad74a..4b81acbd94809e5479f2013deae34ca6dfad5a8a 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DBOBJECTMAP_DB_H
 #define DBOBJECTMAP_DB_H
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include <set>
 #include <map>
 #include <string>
index cacdbc840f39f6c7e08123923b85ff9fb3fe8e5b..6f5a22d20e3372ae745f8bad77464412a9ff73d6 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef CEPH_HASHINDEX_H
 #define CEPH_HASHINDEX_H
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/encoding.h"
 #include "LFNIndex.h"
 
index d5b918698e496ea9fc5141ccadf32c2f7e4bd025..400b1ea8b15f6b0c2b831a1cd4f0c0a55f9bcfe5 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/Context.h"
 #include "common/Finisher.h"
 #include "common/TrackedOp.h"
index d951943a0cef496e95cd30b27e0ddff373dee3f7..fd5a985e362ad3739c3694c93f6504fffb53912c 100644 (file)
@@ -18,7 +18,6 @@
 #include "include/unordered_map.h"
 #include <boost/tuple/tuple.hpp>
 #include "include/memory.h"
-#include "include/buffer.h"
 #include "common/Formatter.h"
 #include "common/hobject.h"
 #include "include/interval_set.h"
index 46a16c379fb43f2dfbd10b045d579c59d1fee8b9..53fe1a203bf8130312278915e60869fa0c6edeea 100644 (file)
@@ -137,6 +137,22 @@ int ECUtil::encode(
   return 0;
 }
 
+void ECUtil::HashInfo::append(uint64_t old_size,
+                             map<int, bufferlist> &to_append) {
+  assert(to_append.size() == cumulative_shard_hashes.size());
+  assert(old_size == total_chunk_size);
+  uint64_t size_to_append = to_append.begin()->second.length();
+  for (map<int, bufferlist>::iterator i = to_append.begin();
+       i != to_append.end();
+       ++i) {
+    assert(size_to_append == i->second.length());
+    assert((unsigned)i->first < cumulative_shard_hashes.size());
+    uint32_t new_hash = i->second.crc32c(cumulative_shard_hashes[i->first]);
+    cumulative_shard_hashes[i->first] = new_hash;
+  }
+  total_chunk_size += size_to_append;
+}
+
 void ECUtil::HashInfo::encode(bufferlist &bl) const
 {
   ENCODE_START(1, 1, bl);
index 08b7f87ed60a4dca3b537850ff6ec3a432b3abf1..8e1261c5ebabd2266ad0109cc6c512beecfd14d8 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "include/memory.h"
 #include "erasure-code/ErasureCodeInterface.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/assert.h"
 #include "include/encoding.h"
 #include "common/Formatter.h"
@@ -112,20 +112,7 @@ public:
   HashInfo(unsigned num_chunks)
   : total_chunk_size(0),
     cumulative_shard_hashes(num_chunks, -1) {}
-  void append(uint64_t old_size, map<int, bufferlist> &to_append) {
-    assert(to_append.size() == cumulative_shard_hashes.size());
-    assert(old_size == total_chunk_size);
-    uint64_t size_to_append = to_append.begin()->second.length();
-    for (map<int, bufferlist>::iterator i = to_append.begin();
-        i != to_append.end();
-        ++i) {
-      assert(size_to_append == i->second.length());
-      assert((unsigned)i->first < cumulative_shard_hashes.size());
-      uint32_t new_hash = i->second.crc32c(cumulative_shard_hashes[i->first]);
-      cumulative_shard_hashes[i->first] = new_hash;
-    }
-    total_chunk_size += size_to_append;
-  }
+  void append(uint64_t old_size, map<int, bufferlist> &to_append);
   void clear() {
     total_chunk_size = 0;
     cumulative_shard_hashes = vector<uint32_t>(
index 1c2c31ccc5f9387522a28f03ad6d183236b60118..fad7fa99497d8ae6c3e68caaf238e41162ca96b5 100644 (file)
@@ -31,7 +31,7 @@
 #include "include/types.h"
 #include "include/stringify.h"
 #include "osd_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/xlist.h"
 #include "include/atomic.h"
 #include "SnapMapper.h"
index 63ef34e98f2c304a936ce31f45fe545807ba02ae..fcceca859ceb32c62738bda42479efc6762498d2 100644 (file)
@@ -5,7 +5,7 @@
 #define CEPH_RBD_REPLAY_ACTION_TYPES_H
 
 #include "include/int_types.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "include/encoding.h"
 #include <iosfwd>
 #include <list>
index 17559331c7a53d7a48dc6cdf57d2382b10703a29..218717b746f70f747be3acf76375291fec6ffd2d 100644 (file)
@@ -18,7 +18,7 @@
 // This code assumes that IO IDs and timestamps are related monotonically.
 // In other words, (a.id < b.id) == (a.timestamp < b.timestamp) for all IOs a and b.
 
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/shared_ptr.hpp>
 #include <iostream>
index 8ca410bd3350383c9088bd223c4f9bdfc2463752..0f467b17e7c24129136cfe0e87871f5f511a2bb2 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 #include "include/interval_set.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include <map>
 
 #ifndef COMMON_OBJECT_H
index 88648f01d73b5e29992515d465aa171ae8e6b0fe..ff99e84374e70901e2c8e2192dda31c82231686c 100644 (file)
@@ -5,6 +5,8 @@
 #include <sstream>
 #include <string>
 
+using namespace ceph;
+
 TEST(tableformatter, singleline)
 {
   std::stringstream sout;
index d3c20349e74dba438aefbb0710532f396c193767..b1aa75d790de2be07c56e144a456a91ad065c7ed 100644 (file)
@@ -9,7 +9,7 @@
 #include "common/Cond.h"
 #include "common/Mutex.h"
 #include "include/atomic.h"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 #include "test/librados_test_stub/TestWatchNotify.h"
 #include <boost/function.hpp>
 #include <boost/functional/hash.hpp>
index 3ce36908429433a65824b5ff04ec66513c0987e5..3a5166306162075003eba4d01e9c4caf8229d0dc 100644 (file)
@@ -18,7 +18,7 @@
 #include <string>
 
 #include "include/rados/librados.hpp"
-#include "include/buffer.h"
+#include "include/buffer_fwd.h"
 
 #include "tools/RadosDump.h"