From: Radoslaw Zarzynski Date: Mon, 16 Jul 2018 21:40:01 +0000 (+0200) Subject: common: drop RefCountObject.cc and improve inlineability. X-Git-Tag: v14.0.1~254^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=99e2c431f15a2c8d735e1a5fc9845f329ecd9ba5;p=ceph.git common: drop RefCountObject.cc and improve inlineability. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index fa85ea598509d..7ed55fdb51b45 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -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 index 058a18b339998..0000000000000 --- a/src/common/RefCountedObj.cc +++ /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 - * - * 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(); -} - diff --git a/src/common/RefCountedObj.h b/src/common/RefCountedObj.h index 510a6682f9888..e28af8b7432c9 100644 --- a/src/common/RefCountedObj.h +++ b/src/common/RefCountedObj.h @@ -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; diff --git a/src/crimson/CMakeLists.txt b/src/crimson/CMakeLists.txt index 4d6302f41b677..149ac3c07c9d8 100644 --- a/src/crimson/CMakeLists.txt +++ b/src/crimson/CMakeLists.txt @@ -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