]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
journaler: add --journaler_safe hack support back
authorSage Weil <sage@newdream.net>
Wed, 31 Dec 2008 19:21:21 +0000 (11:21 -0800)
committerSage Weil <sage@newdream.net>
Wed, 31 Dec 2008 19:21:21 +0000 (11:21 -0800)
src/osdc/Journaler.cc
src/osdc/Journaler.h

index c3306a6c6eac70ca55fcd0faf47c66fedfc76721..a978b78b5be929f3f86dc4109120fb61abc20948 100644 (file)
@@ -276,7 +276,7 @@ void Journaler::_finish_flush(int r, __s64 start, utime_t stamp, bool safe)
 }
 
 
-__s64 Journaler::append_entry(bufferlist& bl, Context *onsync)
+__s64 Journaler::append_entry(bufferlist& bl)
 {
   uint32_t s = bl.length();
 
@@ -323,10 +323,6 @@ __s64 Journaler::append_entry(bufferlist& bl, Context *onsync)
   write_buf.claim_append(bl);
   write_pos += sizeof(s) + s;
 
-  // flush now?
-  if (onsync) 
-    flush(onsync);
-
   return write_pos;
 }
 
@@ -364,6 +360,12 @@ void Journaler::_do_flush()
 
 void Journaler::wait_for_flush(Context *onsync, Context *onsafe, bool add_ack_barrier)
 {
+  if (g_conf.journaler_safe && onsync) {
+    assert(!onsafe);
+    onsafe = onsync;
+    onsync = 0;
+  }
+  
   // all flushed and acked?
   if (write_pos == ack_pos) {
     assert(write_buf.length() == 0);
index ea017f6a8ebf0af503b29d73db4be6dbbf94dc28..9c56cdf904b034807d3e62b97eb9b71b783ecc1e 100644 (file)
@@ -232,7 +232,7 @@ public:
   __s64 get_trimmed_pos() const { return trimmed_pos; }
 
   // write
-  __s64 append_entry(bufferlist& bl, Context *onsync = 0);
+  __s64 append_entry(bufferlist& bl);
   void wait_for_flush(Context *onsync = 0, Context *onsafe = 0, bool add_ack_barrier=false);
   void flush(Context *onsync = 0, Context *onsafe = 0, bool add_ack_barrier=false);