]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake,debian,rpm: remove atomic_t completely
authorKefu Chai <kchai@redhat.com>
Thu, 8 Jun 2017 03:31:51 +0000 (11:31 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 8 Jun 2017 04:21:00 +0000 (12:21 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt
alpine/APKBUILD.in
ceph.spec.in
cmake/modules/Findatomic_ops.cmake [deleted file]
debian/control
install-deps.sh
src/include/atomic.h [deleted file]
src/include/config-h.in.cmake

index 1317765af38883ba3b65b9877827833d1f851d63..c689b0589215904faa66b4bd5bc890f3dda71526 100644 (file)
@@ -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)
index 51245ea5a1f9b55cb263c2f198b42c76000ac68f..90a697d96d3db1ee193cf1934481c083cd49b5bd 100644 (file)
@@ -38,7 +38,6 @@ makedepends="
        keyutils-dev
        leveldb-dev
        libaio-dev
-       libatomic_ops-dev
        libedit-dev
        libressl-dev
        libtirpc-dev
index e415e2b442dd4b2b6da773a49039994ee88bae62..1396db125da45dcc8d1d7f9e6bbc9dc242b5b37f 100644 (file)
@@ -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
diff --git a/cmake/modules/Findatomic_ops.cmake b/cmake/modules/Findatomic_ops.cmake
deleted file mode 100644 (file)
index c6714b7..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# - Find atomic_ops
-# Find the native ATOMIC_OPS headers and libraries.
-#
-#  ATOMIC_OPS_INCLUDE_DIRS - where to find atomic_ops.h, etc.
-#  ATOMIC_OPS_LIBRARIES    - List of libraries when using atomic_ops.
-#  ATOMIC_OPS_FOUND        - True if atomic_ops found.
-
-# Look for the header file.
-FIND_PATH(ATOMIC_OPS_INCLUDE_DIR NAMES atomic_ops.h)
-
-# Look for the library.
-FIND_LIBRARY(ATOMIC_OPS_LIBRARY NAMES atomic_ops)
-
-# handle the QUIETLY and REQUIRED arguments and set ATOMIC_OPS_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(atomic_ops DEFAULT_MSG ATOMIC_OPS_LIBRARY ATOMIC_OPS_INCLUDE_DIR)
-
-# Copy the results to the output variables.
-IF(ATOMIC_OPS_FOUND)
-  SET(ATOMIC_OPS_LIBRARIES ${ATOMIC_OPS_LIBRARY})
-  SET(ATOMIC_OPS_INCLUDE_DIRS ${ATOMIC_OPS_INCLUDE_DIR})
-ELSE(ATOMIC_OPS_FOUND)
-  SET(ATOMIC_OPS_LIBRARIES)
-  SET(ATOMIC_OPS_INCLUDE_DIRS)
-ENDIF(ATOMIC_OPS_FOUND)
-
-MARK_AS_ADVANCED(ATOMIC_OPS_INCLUDE_DIR ATOMIC_OPS_LIBRARY)
index 57bd840b40cde2cf1b293453f1818d6c84c08705..abab52cef84785dd55b89916fb56a6399f7e695d 100644 (file)
@@ -26,7 +26,6 @@ Build-Depends: bc,
               jq,
                junit4,
                libaio-dev,
-               libatomic-ops-dev,
                libbabeltrace-ctf-dev,
                libbabeltrace-dev,
                libblkid-dev (>= 2.17),
index ec3d173919492aff41dfd2ad3177e0302d36ae4f..507cca73c4825058a30fc7b53376a31223834ae3 100755 (executable)
@@ -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 \
diff --git a/src/include/atomic.h b/src/include/atomic.h
deleted file mode 100644 (file)
index d5bc1c7..0000000
+++ /dev/null
@@ -1,157 +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-2011 New Dream Network
- *
- * 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.
- *
- * @author Sage Weil <sage@newdream.net>
- */
-
-#ifndef CEPH_ATOMIC_H
-#define CEPH_ATOMIC_H
-
-#ifdef __CEPH__
-# include "acconfig.h"
-#endif
-
-#include <stdlib.h>
-#include "include/Spinlock.h"
-
-namespace ceph {
-  template <class T>
-  class atomic_spinlock_t {
-    mutable ceph_spinlock_t lock;
-    T val;
-  public:
-    atomic_spinlock_t(T i=0)
-      : val(i) {
-      ceph_spin_init(&lock);
-    }
-    ~atomic_spinlock_t() {
-      ceph_spin_destroy(&lock);
-    }
-    void set(T v) {
-      ceph_spin_lock(&lock);
-      val = v;
-      ceph_spin_unlock(&lock);
-    }
-    T inc() {
-      ceph_spin_lock(&lock);
-      T r = ++val;
-      ceph_spin_unlock(&lock);
-      return r;
-    }
-    T dec() {
-      ceph_spin_lock(&lock);
-      T r = --val;
-      ceph_spin_unlock(&lock);
-      return r;
-    }
-    void add(T d) {
-      ceph_spin_lock(&lock);
-      val += d;
-      ceph_spin_unlock(&lock);
-    }
-    void sub(T d) {
-      ceph_spin_lock(&lock);
-      val -= d;
-      ceph_spin_unlock(&lock);
-    }
-    T read() const {
-      T ret;
-      ceph_spin_lock(&lock);
-      ret = val;
-      ceph_spin_unlock(&lock);
-      return ret;
-    }
-    bool compare_and_swap(T o, T n) {
-      bool success = false;
-      ceph_spin_lock(&lock);
-      if (val == o) {
-        success = true;
-        val = n;
-      }
-      ceph_spin_unlock(&lock);
-      return success;
-    }
-
-  private:
-    // forbid copying
-    atomic_spinlock_t(const atomic_spinlock_t<T> &other);
-    atomic_spinlock_t &operator=(const atomic_spinlock_t<T> &rhs);
-  };
-}
-
-#ifndef NO_ATOMIC_OPS
-
-// libatomic_ops implementation
-#define AO_REQUIRE_CAS
-#include <atomic_ops.h>
-
-// reinclude our assert to clobber the system one
-#include "include/assert.h"
-
-namespace ceph {
-  class atomic_t {
-    AO_t val;
-  public:
-    atomic_t(AO_t i=0) : val(i) {}
-    void set(AO_t v) {
-      AO_store(&val, v);
-    }
-    AO_t inc() {
-      return AO_fetch_and_add1(&val) + 1;
-    }
-    AO_t dec() {
-      return AO_fetch_and_sub1_write(&val) - 1;
-    }
-    AO_t add(AO_t add_me) {
-      return AO_fetch_and_add(&val, add_me) + add_me;
-    }
-    AO_t sub(AO_t sub_me) {
-      AO_t negsub = 0 - sub_me;
-      return AO_fetch_and_add_write(&val, negsub) + negsub;
-    }
-    AO_t read() const {
-      // cast away const on the pointer.  this is only needed to build
-      // on lenny, but not newer debians, so the atomic_ops.h got fixed
-      // at some point.  this hack can go away someday...
-      return AO_load_full((AO_t *)&val);
-    }
-    bool compare_and_swap(AO_t o, AO_t n) {
-      return AO_compare_and_swap(&val, o, n);
-    }
-
-  private:
-    // forbid copying
-    atomic_t(const atomic_t &other);
-    atomic_t &operator=(const atomic_t &rhs);
-  };
-
-#if SIZEOF_AO_T == 8
-  typedef atomic_t atomic64_t;
-#else
-  typedef atomic_spinlock_t<unsigned long long> atomic64_t;
-#endif
-
-}
-
-#else
-/*
- * crappy slow implementation that uses a pthreads spinlock.
- */
-#include "include/Spinlock.h"
-
-namespace ceph {
-  typedef atomic_spinlock_t<unsigned> atomic_t;
-  typedef atomic_spinlock_t<unsigned long long> atomic64_t;
-}
-
-#endif
-#endif
index 20153faed8d10ef877ca5386563052a35da5ecc4..8aff51ec6bce084027216ee2f89996613dfdcc7f 100644 (file)
@@ -84,9 +84,6 @@
 /* Define if you have res_nquery */
 #cmakedefine HAVE_RES_NQUERY
 
-/* Defined if you don't have atomic_ops */
-#cmakedefine NO_ATOMIC_OPS
-
 /* Defined if you have LZ4 */
 #cmakedefine HAVE_LZ4