m_filestore_max_inline_xattrs(0),
m_filestore_max_xattr_value_size(0)
{
- m_filestore_kill_at.set(cct->_conf->filestore_kill_at);
+ m_filestore_kill_at = cct->_conf->filestore_kill_at;
for (int i = 0; i < m_ondisk_finisher_num; ++i) {
ostringstream oss;
oss << "filestore-ondisk-" << i;
osr = static_cast<OpSequencer *>(posr->p.get());
dout(5) << "queue_transactions existing " << osr << " " << *osr << dendl;
} else {
- osr = new OpSequencer(cct, next_osr_id.inc());
+ osr = new OpSequencer(cct, ++next_osr_id);
osr->set_cct(cct);
osr->parent = posr;
posr->p = osr;
void FileStore::_inject_failure()
{
- if (m_filestore_kill_at.read()) {
- int final = m_filestore_kill_at.dec();
+ if (m_filestore_kill_at) {
+ int final = --m_filestore_kill_at;
dout(5) << "_inject_failure " << (final+1) << " -> " << final << dendl;
if (final == 0) {
derr << "_inject_failure KILLING" << dendl;
Mutex::Locker l(lock);
m_filestore_min_sync_interval = conf->filestore_min_sync_interval;
m_filestore_max_sync_interval = conf->filestore_max_sync_interval;
- m_filestore_kill_at.set(conf->filestore_kill_at);
+ m_filestore_kill_at = conf->filestore_kill_at;
m_filestore_fail_eio = conf->filestore_fail_eio;
m_filestore_fadvise = conf->filestore_fadvise;
m_filestore_sloppy_crc = conf->filestore_sloppy_crc;
#include <map>
#include <deque>
-#include <boost/scoped_ptr.hpp>
+#include <atomic>
#include <fstream>
+
using namespace std;
+#include <boost/scoped_ptr.hpp>
+
#include "include/unordered_map.h"
#include "include/assert.h"
FDCache fdcache;
WBThrottle wbthrottle;
- atomic_t next_osr_id;
+ std::atomic<int64_t> next_osr_id = { 0 };
bool m_disable_wbthrottle;
deque<OpSequencer*> op_queue;
BackoffThrottle throttle_ops, throttle_bytes;
bool m_filestore_do_dump;
std::ofstream m_filestore_dump;
JSONFormatter m_filestore_dump_fmt;
- atomic_t m_filestore_kill_at;
+ std::atomic<int64_t> m_filestore_kill_at = { 0 };
bool m_filestore_sloppy_crc;
int m_filestore_sloppy_crc_block_size;
uint64_t m_filestore_max_alloc_hint_size;