From 12952eddd738281f3851472fd7ec758def2b7866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 2 Apr 2008 15:54:22 +0000 Subject: [PATCH] * Quick fix for a possible deadlock I introduced with the block_cache idle notification. We should rework the cache notifications to work asynchronously. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24752 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Journal.cpp | 8 ++++---- src/add-ons/kernel/file_systems/bfs/Journal.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp b/src/add-ons/kernel/file_systems/bfs/Journal.cpp index 5577c77984..8dbde436d8 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp @@ -594,7 +594,7 @@ Journal::_TransactionListener(int32 transactionID, int32 event, void *_journal) // The current transaction seems to be idle - flush it Journal *journal = (Journal *)_journal; - journal->_FlushLog(); + journal->_FlushLog(false, false); } @@ -793,9 +793,9 @@ Journal::_WriteTransactionToLog() also write back all dirty blocks for this volume. */ status_t -Journal::_FlushLog(bool flushBlocks) +Journal::_FlushLog(bool canWait, bool flushBlocks) { - status_t status = fLock.Lock(); + status_t status = canWait ? fLock.Lock() : fLock.LockWithTimeout(0); if (status != B_OK) return status; @@ -827,7 +827,7 @@ Journal::_FlushLog(bool flushBlocks) status_t Journal::FlushLogAndBlocks() { - return _FlushLog(true); + return _FlushLog(true, true); } diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.h b/src/add-ons/kernel/file_systems/bfs/Journal.h index 4cb91db07b..3101c6407d 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.h +++ b/src/add-ons/kernel/file_systems/bfs/Journal.h @@ -52,7 +52,7 @@ class Journal { private: bool _HasSubTransaction() { return fHasSubtransaction; } - status_t _FlushLog(bool flushBlocks = false); + status_t _FlushLog(bool canWait, bool flushBlocks); uint32 _TransactionSize() const; status_t _WriteTransactionToLog(); status_t _CheckRunArray(const run_array *array);