From: Sage Weil Date: Fri, 19 Oct 2018 13:47:53 +0000 (-0500) Subject: common/Readahead: Mutex -> ceph::mutex X-Git-Tag: v14.1.0~820^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=774e67a1260a93a6c57a196d531dd2585a76794a;p=ceph.git common/Readahead: Mutex -> ceph::mutex Still need to kill C_SaferCond later. Signed-off-by: Sage Weil --- diff --git a/src/common/Readahead.cc b/src/common/Readahead.cc index 51964fcd50e0..2d2b35ff781f 100644 --- a/src/common/Readahead.cc +++ b/src/common/Readahead.cc @@ -1,23 +1,21 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#include "Readahead.h" - +#include "common/Readahead.h" +#include "common/Cond.h" Readahead::Readahead() : m_trigger_requests(10), m_readahead_min_bytes(0), m_readahead_max_bytes(NO_LIMIT), m_alignments(), - m_lock("Readahead::m_lock"), m_nr_consec_read(0), m_consec_read_bytes(0), m_last_pos(0), m_readahead_pos(0), m_readahead_trigger_pos(0), m_readahead_size(0), - m_pending(0), - m_pending_lock("Readahead::m_pending_lock") { + m_pending(0) { } Readahead::~Readahead() { diff --git a/src/common/Readahead.h b/src/common/Readahead.h index 26b05b67a382..716e58cd3a27 100644 --- a/src/common/Readahead.h +++ b/src/common/Readahead.h @@ -4,9 +4,11 @@ #ifndef CEPH_READAHEAD_H #define CEPH_READAHEAD_H -#include "Mutex.h" -#include "Cond.h" #include +#include + +#include "include/Context.h" +#include "common/ceph_mutex.h" /** This class provides common state and logic for code that needs to perform readahead @@ -39,7 +41,7 @@ public: @param extents read operations since last call to update @param limit size of the thing readahead is being applied to */ - extent_t update(const vector& extents, uint64_t limit); + extent_t update(const std::vector& extents, uint64_t limit); /** Update state with a new read and return readahead to be performed. @@ -132,7 +134,7 @@ private: std::vector m_alignments; /// Held while reading/modifying any state except m_pending - Mutex m_lock; + ceph::mutex m_lock = ceph::make_mutex("Readahead::m_lock"); /// Number of consecutive read requests in the current sequential stream int m_nr_consec_read; @@ -156,7 +158,7 @@ private: int m_pending; /// Lock for m_pending - Mutex m_pending_lock; + ceph::mutex m_pending_lock = ceph::make_mutex("Readahead::m_pending_lock"); /// Waiters for pending readahead std::list m_pending_waiting;