]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: cleanup code style and delete useless data
authorshangdehao1 <dehao.shang@intel.com>
Thu, 14 Mar 2019 18:05:05 +0000 (02:05 +0800)
committerYuan Zhou <yuan.zhou@intel.com>
Thu, 21 Mar 2019 16:16:31 +0000 (00:16 +0800)
Signed-off-by: Dehao Shang <dehao.shang@intel.com>
src/tools/immutable_object_cache/CacheClient.h
src/tools/immutable_object_cache/CacheController.h
src/tools/immutable_object_cache/CacheSession.h
src/tools/immutable_object_cache/ObjectCacheStore.cc
src/tools/immutable_object_cache/ObjectCacheStore.h
src/tools/immutable_object_cache/SimplePolicy.h
src/tools/immutable_object_cache/SocketCommon.h
src/tools/immutable_object_cache/Types.h
src/tools/immutable_object_cache/Utils.h

index 3d0706ea4d9fdca4482aee190ef4431a2ea3ecf1..54a35dec761b5ead3eecacc67e16afee0a65b0d6 100644 (file)
@@ -79,4 +79,4 @@ class CacheClient {
 
 }  // namespace immutable_obj_cache
 }  // namespace ceph
-#endif
+#endif  // CEPH_CACHE_CACHE_CLIENT_H
index bdb5c8e63fc66ddf77285af6b80004b4f0e14697..bf5ae0714771270d5b0e5762d09dcc7602c58ba1 100644 (file)
@@ -37,4 +37,4 @@ class CacheController {
 }  // namespace immutable_obj_cache
 }  // namespace ceph
 
-#endif
+#endif  // CEPH_CACHE_CACHE_CONTROLLER_H
index 2e66aa83f351d73fd62478cda6c70003c57f2ea1..575dcf9221d22bfa94e679a4bd6dee6dd3ac9fa3 100644 (file)
@@ -49,4 +49,4 @@ typedef std::shared_ptr<CacheSession> CacheSessionPtr;
 }  // namespace immutable_obj_cache
 }  // namespace ceph
 
-#endif
+#endif  // CEPH_CACHE_SESSION_H
index cdd0e91cc52938f3f764b25f0cbbe1337ba43d4b..8f7dad8797fe7236b41c3c11186b63fa13a9c567 100644 (file)
@@ -60,7 +60,7 @@ int ObjectCacheStore::init(bool reset) {
     std::error_code ec;
     if (efs::exists(m_cache_root_dir)) {
       // remove all sub folders
-      for(auto& p: efs::directory_iterator(m_cache_root_dir)) {
+      for (auto& p : efs::directory_iterator(m_cache_root_dir)) {
         efs::remove_all(p.path());
       }
     } else {
index aaa8e0bc31e191dee1eace05c79e023528008dfb..6ef977827ec80ac71e9ef709731a815e55532567 100644 (file)
@@ -36,7 +36,8 @@ class ObjectCacheStore {
  private:
   std::string get_cache_file_name(std::string pool_nspace, uint64_t pool_id,
                                   uint64_t snap_id, std::string oid);
-  std::string get_cache_file_path(std::string cache_file_name, bool mkdir = false);
+  std::string get_cache_file_path(std::string cache_file_name,
+                                  bool mkdir = false);
   int evict_objects();
   int do_promote(std::string pool_nspace, uint64_t pool_id,
                  uint64_t snap_id, std::string object_name);
@@ -56,6 +57,6 @@ class ObjectCacheStore {
   std::string m_cache_root_dir;
 };
 
-}  // namespace ceph
-}  // namespace immutable_obj_cache
-#endif
+}  // namespace immutable_obje_cache
+}  // ceph
+#endif  // CEPH_CACHE_OBJECT_CACHE_STORE_H
index 9ff00b26a520258d9de27878ed06b4e7a4d91871..2b79f0a851d19e6c1f718e41613a58f105072868 100644 (file)
@@ -50,7 +50,6 @@ class SimplePolicy : public Policy {
 
   CephContext* cct;
   float m_watermark;
-  uint64_t m_entry_count;
   uint64_t m_max_inflight_ops;
   uint64_t m_max_cache_size;
   std::atomic<uint64_t> inflight_ops = 0;
@@ -58,8 +57,6 @@ class SimplePolicy : public Policy {
   std::unordered_map<std::string, Entry*> m_cache_map;
   RWLock m_cache_map_lock;
 
-  std::deque<Entry*> m_free_list;
-
   std::atomic<uint64_t> m_cache_size;
 
   LRU m_promoted_lru;
index 4bbc2f611e68da14a7006b9d56e4232f71fc048b..341550a5ff309b90c893c065044dff7e67ec29db 100644 (file)
@@ -26,4 +26,4 @@ typedef std::function<void(CacheSession*, ObjectCacheRequest*)> ProcessMsg;
 
 }  // namespace immutable_obj_cache
 }  // namespace ceph
-#endif
+#endif  // CEPH_CACHE_SOCKET_COMMON_H
index fb2ef13f4da62bff66f04d0c7d36b9e927e3ced0..d08cdfedcf8e58abeddb706fd5c5401442ec82df 100644 (file)
@@ -124,4 +124,4 @@ ObjectCacheRequest* decode_object_cache_request(bufferlist payload_buffer);
 
 }  // namespace immutable_obj_cache
 }  // namespace ceph
-#endif
+#endif  // CEPH_CACHE_TYPES_H
index 71e716bfc2211d0f5f14240e24248bffe88ae0c2..38f6506652493a0f0c5c456d0d60c8d6d7442e97 100644 (file)
@@ -28,4 +28,4 @@ librados::AioCompletion *create_rados_callback(T *obj) {
 
 }  // namespace immutable_obj_cache
 }  // namespace ceph
-#endif
+#endif  // CEPH_CACHE_UTILS_H