]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge pull request #25105 from tchaikov/wip-ceph-mutex-common
authorKefu Chai <tchaikov@gmail.com>
Mon, 26 Nov 2018 10:49:12 +0000 (18:49 +0800)
committerGitHub <noreply@github.com>
Mon, 26 Nov 2018 10:49:12 +0000 (18:49 +0800)
common: Mutex -> ceph::mutex

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Adam Emerson <aemerson@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
1  2 
src/common/Throttle.cc
src/common/Throttle.h
src/osd/OSD.cc

index d933a86f333d5d83d84ad54bf63d8c2214fbad1e,c80ad2b571e1ee8d1913d7abb2dda3d313439d37..4d0e3409664750fb9ae11284326bc3e345a74159
@@@ -790,11 -796,9 +796,11 @@@ uint64_t TokenBucketThrottle::tokens_th
  void TokenBucketThrottle::add_tokens() {
    list<Blocker> tmp_blockers;
    {
-     std::lock_guard<Mutex> lock(m_lock);
+     std::lock_guard lock(m_lock);
      // put tokens into bucket.
      m_throttle.put(tokens_this_tick());
 +    if (0 == m_avg || 0 == m_throttle.max)
 +      tmp_blockers.swap(m_blockers);
      // check the m_blockers from head to tail, if blocker can get
      // enough tokens, let it go.
      while (!m_blockers.empty()) {
index a70b28c0c19f816ef52f12ce5214fcbb31899dfc,5b31366d9faa6db2e3b3f4516e119173b5899344..0164dc9815ab3bf611a57ece55bdf90766b9ae7c
@@@ -422,12 -421,12 +421,12 @@@ public
    
    template <typename T, typename I, void(T::*MF)(int, I*, uint64_t)>
    bool get(uint64_t c, T *handler, I *item, uint64_t flag) {
 -    if (0 == m_avg)
 +    if (0 == c)
        return false;
 -  
 +
      bool wait = false;
      uint64_t got = 0;
-     std::lock_guard<Mutex> lock(m_lock);
+     std::lock_guard lock(m_lock);
      if (!m_blockers.empty()) {
        // Keep the order of requests, add item after previous blocked requests.
        wait = true;
diff --cc src/osd/OSD.cc
Simple merge