]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: migrate atomic_t to <atomic>
authorJesse Williamson <jwilliamson@suse.de>
Tue, 23 May 2017 12:49:15 +0000 (05:49 -0700)
committerJesse Williamson <jwilliamson@suse.de>
Sun, 28 May 2017 15:47:40 +0000 (08:47 -0700)
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
src/client/MetaRequest.h

index e0eac4a157e01561ca71795842d03a27be222f06..94261ceb58d224c2b091acf74ec1495028d40f0a 100644 (file)
@@ -48,7 +48,7 @@ public:
   __u32    sent_on_mseq;       // mseq at last submission of this request
   int      num_fwd;            // # of times i've been forwarded
   int      retry_attempt;
-  atomic_t ref;
+  std::atomic<uint64_t> ref = { 1 };
   
   MClientReply *reply;         // the reply
   bool kick;
@@ -83,7 +83,7 @@ public:
     regetattr_mask(0),
     mds(-1), resend_mds(-1), send_to_auth(false), sent_on_mseq(0),
     num_fwd(0), retry_attempt(0),
-    ref(1), reply(0), 
+    reply(0), 
     kick(false), success(false),
     got_unsafe(false), item(this), unsafe_item(this),
     unsafe_dir_item(this), unsafe_target_item(this),
@@ -153,13 +153,13 @@ public:
   Dentry *old_dentry();
 
   MetaRequest* get() {
-    ref.inc();
+    ref++;
     return this;
   }
 
   /// psuedo-private put method; use Client::put_request()
   bool _put() {
-    int v = ref.dec();
+    int v = --ref;
     return v == 0;
   }