]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
journal: implicitly detach future's flush handler on append
authorJason Dillaman <dillaman@redhat.com>
Fri, 13 May 2016 20:10:11 +0000 (16:10 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 20 May 2016 00:28:46 +0000 (20:28 -0400)
If the future is already in-flight, there is no purpose served
by requesting the future be flushed to disk.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 1cb9b1a1b25d0f4c2d9a9e22661636e195fc70a0)

src/journal/FutureImpl.h

index 5c11c4bb105004a87274554d4a3f85ab14fa77ea..0d5e86fbddf679f58ff1607bf13ac895bcec94ee 100644 (file)
@@ -56,13 +56,14 @@ public:
   }
   inline void set_flush_in_progress() {
     Mutex::Locker locker(m_lock);
+    assert(m_flush_handler);
+    m_flush_handler.reset();
     m_flush_state = FLUSH_STATE_IN_PROGRESS;
   }
 
   bool attach(const FlushHandlerPtr &flush_handler);
   inline void detach() {
     Mutex::Locker locker(m_lock);
-    assert(m_flush_handler);
     m_flush_handler.reset();
   }
   inline FlushHandlerPtr get_flush_handler() const {