]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: drop RefCountObject.cc and improve inlineability. 23092/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 16 Jul 2018 21:40:01 +0000 (23:40 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 13 Sep 2018 22:50:07 +0000 (00:50 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/CMakeLists.txt
src/common/RefCountedObj.cc [deleted file]
src/common/RefCountedObj.h
src/crimson/CMakeLists.txt

index fa85ea598509df500ca10201ae6ed7fb17299f10..7ed55fdb51b45ba730c6bf78db752ac8e687d0f8 100644 (file)
@@ -24,7 +24,6 @@ set(common_srcs
   PrebufferedStreambuf.cc
   PriorityCache.cc
   Readahead.cc
-  RefCountedObj.cc
   SloppyCRCMap.cc
   SubProcess.cc
   Thread.cc
diff --git a/src/common/RefCountedObj.cc b/src/common/RefCountedObj.cc
deleted file mode 100644 (file)
index 058a18b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
- * Foundation.  See file COPYING.
- * 
- */
-
-#include "common/RefCountedObj.h"
-
-void intrusive_ptr_add_ref(const RefCountedObject *p) {
-  p->get();
-}
-void intrusive_ptr_release(const RefCountedObject *p) {
-  p->put();
-}
-
index 510a6682f9888fbf29cbcb24f709600005f65475..e28af8b7432c9d1bda406839704d66ff9b895279 100644 (file)
@@ -163,8 +163,12 @@ struct RefCountedWaitObject {
   }
 };
 
-void intrusive_ptr_add_ref(const RefCountedObject *p);
-void intrusive_ptr_release(const RefCountedObject *p);
+static inline void intrusive_ptr_add_ref(const RefCountedObject *p) {
+  p->get();
+}
+static inline void intrusive_ptr_release(const RefCountedObject *p) {
+  p->put();
+}
 
 using RefCountedPtr = boost::intrusive_ptr<RefCountedObject>;
 
index 4d6302f41b6773d4b53f1a4ce87bda83bb40ebba..149ac3c07c9d8710a90d3e749c3af8365011dfc9 100644 (file)
@@ -68,7 +68,6 @@ add_library(crimson-common STATIC
   ${PROJECT_SOURCE_DIR}/src/common/Graylog.cc
   ${PROJECT_SOURCE_DIR}/src/common/LogEntry.cc
   ${PROJECT_SOURCE_DIR}/src/common/Mutex.cc
-  ${PROJECT_SOURCE_DIR}/src/common/RefCountedObj.cc
   ${PROJECT_SOURCE_DIR}/src/common/SubProcess.cc
   ${PROJECT_SOURCE_DIR}/src/common/TextTable.cc
   ${PROJECT_SOURCE_DIR}/src/common/Thread.cc