]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "os/FileJournal: stop aio completion thread *after* writer thread"
authorSage Weil <sage@redhat.com>
Tue, 21 Oct 2014 13:53:36 +0000 (06:53 -0700)
committerSage Weil <sage@redhat.com>
Tue, 21 Oct 2014 13:53:36 +0000 (06:53 -0700)
This reverts commit 334631ae4641824b3df49245f36a8fd4b143bf3f.

src/os/FileJournal.cc
src/os/FileJournal.h

index 88f575d74c69ee50ad45dd7bea2492c165942e6c..7eb7927e0412a476043e603d1d3110f826769424 100644 (file)
@@ -602,7 +602,6 @@ int FileJournal::dump(ostream& out)
 void FileJournal::start_writer()
 {
   write_stop = false;
-  aio_stop = false;
   write_thread.create();
 #ifdef HAVE_LIBAIO
   write_finish_thread.create();
@@ -613,23 +612,20 @@ void FileJournal::stop_writer()
 {
   {
     Mutex::Locker l(write_lock);
+#ifdef HAVE_LIBAIO
+    Mutex::Locker q(aio_lock);
+#endif
     Mutex::Locker p(writeq_lock);
     write_stop = true;
     writeq_cond.Signal();
-  }
-  write_thread.join();
-
 #ifdef HAVE_LIBAIO
-  // stop aio completeion thread *after* writer thread has stopped
-  // and has submitted all of its io
-  if (aio) {
-    aio_lock.Lock();
-    aio_stop = true;
     aio_cond.Signal();
     write_finish_cond.Signal();
-    aio_lock.Unlock();
-    write_finish_thread.join();
-  }
+#endif
+  } 
+  write_thread.join();
+#ifdef HAVE_LIBAIO
+  write_finish_thread.join();
 #endif
 }
 
@@ -1331,7 +1327,7 @@ void FileJournal::write_finish_thread_entry()
     {
       Mutex::Locker locker(aio_lock);
       if (aio_queue.empty()) {
-       if (aio_stop)
+       if (write_stop)
          break;
        dout(20) << "write_finish_thread_entry sleeping" << dendl;
        write_finish_cond.Wait(aio_lock);
index 31cf289ed13f5d6773d37b22d922ff6125d6e5ea..dbb1181bc8ed678c37c44e1baf2bda7ee3ff24ce 100644 (file)
@@ -288,7 +288,6 @@ private:
   // write thread
   Mutex write_lock;
   bool write_stop;
-  bool aio_stop;
 
   Cond commit_cond;
 
@@ -380,7 +379,6 @@ private:
     throttle_bytes(g_ceph_context, "filestore_bytes"),
     write_lock("FileJournal::write_lock", false, true, false, g_ceph_context),
     write_stop(false),
-    aio_stop(false),
     write_thread(this),
     write_finish_thread(this) { }
   ~FileJournal() {