void FreelistManager::dump()
{
- Mutex::Locker l(lock);
+ std::lock_guard<std::mutex> l(lock);
_dump();
}
void FreelistManager::_audit()
{
- assert(lock.is_locked());
uint64_t sum = 0;
for (auto& p : kv_free) {
sum += p.second;
uint64_t offset, uint64_t length,
KeyValueDB::Transaction txn)
{
- Mutex::Locker l(lock);
+ std::lock_guard<std::mutex> l(lock);
dout(10) << __func__ << " " << offset << "~" << length << dendl;
total_free -= length;
auto p = kv_free.lower_bound(offset);
uint64_t offset, uint64_t length,
KeyValueDB::Transaction txn)
{
- Mutex::Locker l(lock);
+ std::lock_guard<std::mutex> l(lock);
dout(10) << __func__ << " " << offset << "~" << length << dendl;
total_free += length;
auto p = kv_free.lower_bound(offset);
#include <string>
#include <map>
+#include <mutex>
#include <ostream>
-#include "common/Mutex.h"
#include "kv/KeyValueDB.h"
class FreelistManager {
std::string prefix;
- Mutex lock;
+ std::mutex lock;
uint64_t total_free;
std::map<uint64_t, uint64_t> kv_free; ///< mirrors our kv values in the db
public:
FreelistManager() :
- lock("FreelistManager::lock"),
total_free(0) {
}
void dump();
uint64_t get_total_free() {
- Mutex::Locker l(lock);
+ std::lock_guard<std::mutex> l(lock);
return total_free;
}