Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common,osdc: remove atomic_t completely #15562

Merged
merged 9 commits into from Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions CMakeLists.txt
Expand Up @@ -250,12 +250,6 @@ if(WITH_LEVELDB)
find_file(HAVE_LEVELDB_FILTER_POLICY leveldb/filter_policy.h PATHS ${LEVELDB_INCLUDE_DIR})
endif(WITH_LEVELDB)

find_package(atomic_ops REQUIRED)
message(STATUS "${ATOMIC_OPS_LIBRARIES}")
if(NOT ${ATOMIC_OPS_FOUND})
set(NO_ATOMIC_OPS 1)
endif(NOT ${ATOMIC_OPS_FOUND})

find_package(snappy REQUIRED)

option(WITH_LZ4 "LZ4 compression support" OFF)
Expand Down
1 change: 0 additions & 1 deletion alpine/APKBUILD.in
Expand Up @@ -38,7 +38,6 @@ makedepends="
keyutils-dev
leveldb-dev
libaio-dev
libatomic_ops-dev
libedit-dev
libressl-dev
libtirpc-dev
Expand Down
1 change: 0 additions & 1 deletion ceph.spec.in
Expand Up @@ -115,7 +115,6 @@ BuildRequires: gperftools-devel >= 2.4
BuildRequires: jq
BuildRequires: leveldb-devel > 1.2
BuildRequires: libaio-devel
BuildRequires: libatomic_ops-devel
BuildRequires: libblkid-devel >= 2.17
BuildRequires: libcurl-devel
BuildRequires: libudev-devel
Expand Down
28 changes: 0 additions & 28 deletions cmake/modules/Findatomic_ops.cmake

This file was deleted.

1 change: 0 additions & 1 deletion debian/control
Expand Up @@ -26,7 +26,6 @@ Build-Depends: bc,
jq,
junit4,
libaio-dev,
libatomic-ops-dev,
libbabeltrace-ctf-dev,
libbabeltrace-dev,
libblkid-dev (>= 2.17),
Expand Down
1 change: 0 additions & 1 deletion install-deps.sh
Expand Up @@ -30,7 +30,6 @@ if [ x`uname`x = xFreeBSDx ]; then
devel/boost-python-libs \
devel/valgrind \
devel/pkgconf \
devel/libatomic_ops \
devel/libedit \
devel/libtool \
devel/google-perftools \
Expand Down
1 change: 0 additions & 1 deletion src/client/MetaRequest.h
Expand Up @@ -8,7 +8,6 @@
#include "include/types.h"
#include "include/xlist.h"
#include "include/filepath.h"
#include "include/atomic.h"
#include "mds/mdstypes.h"
#include "InodeRef.h"
#include "UserPerm.h"
Expand Down
2 changes: 1 addition & 1 deletion src/client/hypertable/CephBroker.cc
Expand Up @@ -41,7 +41,7 @@

using namespace Hypertable;

atomic_t CephBroker::ms_next_fd = ATOMIC_INIT(0);
std::atomic<int> CephBroker::ms_next_fd{0};

/* A thread-safe version of strerror */
static std::string cpp_strerror(int err)
Expand Down
5 changes: 2 additions & 3 deletions src/client/hypertable/CephBroker.h
Expand Up @@ -27,9 +27,8 @@
extern "C" {
#include <unistd.h>
}

#include <atomic>
#include "Common/String.h"
#include "Common/atomic.h"
#include "Common/Properties.h"

#include "DfsBroker/Lib/Broker.h"
Expand Down Expand Up @@ -97,7 +96,7 @@ namespace Hypertable {

private:
struct ceph_mount_info *cmount;
static atomic_t ms_next_fd;
static std::atomic<int> ms_next_fd;

virtual void report_error(ResponseCallback *cb, int error);

Expand Down
5 changes: 0 additions & 5 deletions src/common/Finisher.cc
Expand Up @@ -3,11 +3,6 @@

#include "Finisher.h"

#include "common/debug.h"

// re-include our assert to clobber the system one; fix dout:
#include "include/assert.h"

#define dout_subsys ceph_subsys_finisher
#undef dout_prefix
#define dout_prefix *_dout << "finisher(" << this << ") "
Expand Down
3 changes: 2 additions & 1 deletion src/common/ceph_context.cc
Expand Up @@ -27,6 +27,7 @@
#include "include/str_list.h"
#include "common/PluginRegistry.h"

using ceph::bufferlist;
using ceph::HeartbeatMap;

namespace {
Expand Down Expand Up @@ -682,7 +683,7 @@ CephContext::~CephContext()
}

void CephContext::put() {
if (nref.dec() == 0) {
if (--nref == 0) {
ANNOTATE_HAPPENS_AFTER(&nref);
ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(&nref);
delete this;
Expand Down
13 changes: 6 additions & 7 deletions src/common/ceph_context.h
Expand Up @@ -15,12 +15,13 @@
#ifndef CEPH_CEPHCONTEXT_H
#define CEPH_CEPHCONTEXT_H

#include <atomic>
#include <set>
#include <boost/noncopyable.hpp>

#include "include/atomic.h"
#include "common/cmdparse.h"
#include "crush/CrushLocation.h"
#include <boost/noncopyable.hpp>
#include "include/Spinlock.h"

class AdminSocket;
class CephContextServiceThread;
Expand All @@ -40,8 +41,6 @@ namespace ceph {
}
}

using ceph::bufferlist;

/* A CephContext represents the context held by a single library user.
* There can be multiple CephContexts in the same process.
*
Expand All @@ -56,10 +55,10 @@ class CephContext {
// ref count!
private:
~CephContext();
atomic_t nref;
std::atomic<unsigned> nref;
public:
CephContext *get() {
nref.inc();
++nref;
return this;
}
void put();
Expand Down Expand Up @@ -119,7 +118,7 @@ class CephContext {
* process an admin socket command
*/
void do_command(std::string command, cmdmap_t& cmdmap, std::string format,
bufferlist *out);
ceph::bufferlist *out);

template<typename T>
void lookup_or_create_singleton_object(T*& p, const std::string &name) {
Expand Down
3 changes: 2 additions & 1 deletion src/common/cmdparse.h
Expand Up @@ -3,10 +3,11 @@
#ifndef CEPH_COMMON_CMDPARSE_H
#define CEPH_COMMON_CMDPARSE_H

#include <boost/variant.hpp>
#include <vector>
#include <stdexcept>
#include <ostream>
#include <boost/variant.hpp>
#include "include/assert.h" // boost clobbers this
#include "common/Formatter.h"
#include "common/BackTrace.h"

Expand Down
2 changes: 1 addition & 1 deletion src/common/perf_histogram.h
Expand Up @@ -18,10 +18,10 @@
#include <array>
#include <atomic>
#include <memory>
#include <cassert>

#include "common/Formatter.h"
#include "include/int_types.h"
#include "include/assert.h"

class PerfHistogramCommon {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/compressor/Compressor.h
Expand Up @@ -16,10 +16,10 @@
#define CEPH_COMPRESSOR_H


#include <boost/optional.hpp>
#include <memory>
#include <string>

#include <boost/optional.hpp>
#include "include/assert.h" // boost clobbers this
#include "include/buffer.h"
#include "include/int_types.h"

Expand Down
2 changes: 1 addition & 1 deletion src/crush/CrushWrapper.h
Expand Up @@ -20,13 +20,13 @@ extern "C" {
#include "builder.h"
}

#include "include/assert.h"
#include "include/err.h"
#include "include/encoding.h"


#include "common/Mutex.h"

#include "include/assert.h"
#define BUG_ON(x) assert(!(x))

namespace ceph {
Expand Down
157 changes: 0 additions & 157 deletions src/include/atomic.h

This file was deleted.