[haiku-commits] haiku: hrev44630 - src/add-ons/kernel/file_systems/bfs

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 12 Sep 2012 20:21:47 +0200 (CEST)

hrev44630 adds 1 changeset to branch 'master'
old head: 30aeebc7164b9db52cca6bed650c23331f5f45c0
new head: 267b64639698c8aaca919137b8d65803abc1b026

----------------------------------------------------------------------------

267b646: Run the transaction flusher in another thread.
  
  * This fixes bug #8977.

                                   [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44630
Commit:      267b64639698c8aaca919137b8d65803abc1b026
URL:         http://cgit.haiku-os.org/haiku/commit/?id=267b646
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Wed Sep 12 18:20:43 2012 UTC

Ticket:      https://dev.haiku-os.org/ticket/8977

----------------------------------------------------------------------------

2 files changed, 14 insertions(+), 2 deletions(-)
src/add-ons/kernel/file_systems/bfs/Journal.cpp |   14 ++++++++++++--
src/add-ons/kernel/file_systems/bfs/Journal.h   |    2 ++

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp 
b/src/add-ons/kernel/file_systems/bfs/Journal.cpp
index f1a1f74..473ad28 100644
--- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp
+++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp
@@ -684,10 +684,20 @@ Journal::_TransactionWritten(int32 transactionID, int32 
event, void* _logEntry)
 /*static*/ void
 Journal::_TransactionIdle(int32 transactionID, int32 event, void* _journal)
 {
-       // The current transaction seems to be idle - flush it
+       // The current transaction seems to be idle - flush it. We can't do this
+       // in this thread, as flushing the log can produce new transaction 
events.
+       thread_id id = spawn_kernel_thread(&Journal::_FlushLog, "bfs log 
flusher",
+               B_NORMAL_PRIORITY, _journal);
+       if (id > 0)
+               resume_thread(id);
+}
+
 
+/*static*/ status_t
+Journal::_FlushLog(void* _journal)
+{
        Journal* journal = (Journal*)_journal;
-       journal->_FlushLog(false, false);
+       return journal->_FlushLog(false, false);
 }
 
 
diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.h 
b/src/add-ons/kernel/file_systems/bfs/Journal.h
index c128a96..6e22ad0 100644
--- a/src/add-ons/kernel/file_systems/bfs/Journal.h
+++ b/src/add-ons/kernel/file_systems/bfs/Journal.h
@@ -60,7 +60,9 @@ private:
                                                                int32 event, 
void* _logEntry);
        static  void                    _TransactionIdle(int32 transactionID, 
int32 event,
                                                                void* _journal);
+       static  status_t                _FlushLog(void* _journal);
 
+private:
                        Volume*                 fVolume;
                        recursive_lock  fLock;
                        Transaction*    fOwner;


Other related posts:

  • » [haiku-commits] haiku: hrev44630 - src/add-ons/kernel/file_systems/bfs - axeld