]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FuseStore: wait for commit and flush in all updates
authorSage Weil <sage@redhat.com>
Fri, 15 Jan 2016 00:17:53 +0000 (19:17 -0500)
committerSage Weil <sage@redhat.com>
Wed, 27 Jan 2016 19:06:14 +0000 (14:06 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FuseStore.cc

index 5d8303b7372a9ff65d02709debd8585fca60857a..1895a760d5885e56c3c31f9c1962d09dd774fbb9 100644 (file)
@@ -661,7 +661,9 @@ static int os_mkdir(const char *path, mode_t mode)
     ceph::shared_ptr<ObjectStore::Sequencer> osr(
       new ObjectStore::Sequencer("fuse"));
     fs->store->apply_transaction(&*osr, t);
-    osr->flush();
+    C_SaferCond waiter;
+    if (!osr->flush_commit(&waiter))
+      waiter.wait();
   }
 
   return 0;
@@ -730,7 +732,9 @@ static int os_create(const char *path, mode_t mode, struct fuse_file_info *fi)
     ceph::shared_ptr<ObjectStore::Sequencer> osr(
       new ObjectStore::Sequencer("fuse"));
     fs->store->apply_transaction(&*osr, t);
-    osr->flush();
+    C_SaferCond waiter;
+    if (!osr->flush_commit(&waiter))
+      waiter.wait();
   }
 
   if (pbl) {
@@ -838,7 +842,9 @@ int os_flush(const char *path, struct fuse_file_info *fi)
   ceph::shared_ptr<ObjectStore::Sequencer> osr(
     new ObjectStore::Sequencer("fuse"));
   fs->store->apply_transaction(&*osr, t);
-  osr->flush();
+  C_SaferCond waiter;
+  if (!osr->flush_commit(&waiter))
+    waiter.wait();
 
   return 0;
 }
@@ -899,7 +905,9 @@ static int os_unlink(const char *path)
   ceph::shared_ptr<ObjectStore::Sequencer> osr(
     new ObjectStore::Sequencer("fuse"));
   fs->store->apply_transaction(&*osr, t);
-  osr->flush();
+  C_SaferCond waiter;
+  if (!osr->flush_commit(&waiter))
+    waiter.wait();
 
   return 0;
 }
@@ -932,7 +940,9 @@ static int os_truncate(const char *path, off_t size)
   ceph::shared_ptr<ObjectStore::Sequencer> osr(
     new ObjectStore::Sequencer("fuse"));
   fs->store->apply_transaction(&*osr, t);
-  osr->flush();
+  C_SaferCond waiter;
+  if (!osr->flush_commit(&waiter))
+    waiter.wait();
   return 0;
 }