Skip to content

Commit

Permalink
os/bluestore: upgrade wal_seq to std::atomic
Browse files Browse the repository at this point in the history
Signed-off-by: xie xingguo <[email protected]>
  • Loading branch information
xiexingguo committed Oct 6, 2016
1 parent afbcece commit cbbd546
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,6 @@ BlueStore::BlueStore(CephContext *cct, const string& path)
throttle_wal_bytes(cct, "bluestore_wal_max_bytes",
cct->_conf->bluestore_max_bytes +
cct->_conf->bluestore_wal_max_bytes),
wal_seq(0),
wal_tp(cct,
"BlueStore::wal_tp",
"tp_wal",
Expand Down Expand Up @@ -6718,7 +6717,7 @@ int BlueStore::queue_transactions(
txc->wal_txn->released.swap(txc->released);
assert(txc->released.empty());

txc->wal_txn->seq = wal_seq.inc();
txc->wal_txn->seq = ++wal_seq;
bufferlist bl;
::encode(*txc->wal_txn, bl);
string key;
Expand Down
2 changes: 1 addition & 1 deletion src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ class BlueStore : public ObjectStore,
interval_set<uint64_t> bluefs_extents; ///< block extents owned by bluefs

std::mutex wal_lock;
atomic64_t wal_seq;
std::atomic<uint64_t> wal_seq = {0};
ThreadPool wal_tp;
WALWQ wal_wq;

Expand Down

0 comments on commit cbbd546

Please sign in to comment.