]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: upgrade wal_seq to std::atomic
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 6 Oct 2016 07:36:20 +0000 (15:36 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 6 Oct 2016 07:36:20 +0000 (15:36 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index b827cef883c3cdc292324405f4b035d642977840..77d2c1ee89aaf8c0ca1b916105a7e5705b84ca71 100644 (file)
@@ -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",
@@ -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;
index 6307c4604617856cb1ff23f7bc9ad4e87cd6082e..ddcb7bfcd3bf4889a01ad919a28784195846d922 100644 (file)
@@ -1397,7 +1397,7 @@ private:
   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;