Journal::FlushLogAndBlocks() no longer uses Journal::Lock() but the lock directly.
That avoids starting a new transaction for no reason (which wouldn't do any harm, but still, it's not necessary to do that at all). log_entry::cached_blocks is no longer maintained or needed. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10185 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -181,6 +181,8 @@ Journal::blockNotify(int32 transactionID, void *arg)
|
|||||||
{
|
{
|
||||||
log_entry *logEntry = (log_entry *)arg;
|
log_entry *logEntry = (log_entry *)arg;
|
||||||
|
|
||||||
|
PRINT(("Log entry %p has been finished, transaction ID = %ld\n", logEntry, transactionID));
|
||||||
|
|
||||||
Journal *journal = logEntry->journal;
|
Journal *journal = logEntry->journal;
|
||||||
disk_super_block &superBlock = journal->fVolume->SuperBlock();
|
disk_super_block &superBlock = journal->fVolume->SuperBlock();
|
||||||
bool update = false;
|
bool update = false;
|
||||||
@@ -283,7 +285,6 @@ Journal::WriteLogEntry()
|
|||||||
if (logEntry != NULL) {
|
if (logEntry != NULL) {
|
||||||
logEntry->start = logStart;
|
logEntry->start = logStart;
|
||||||
logEntry->length = TransactionSize();
|
logEntry->length = TransactionSize();
|
||||||
logEntry->cached_blocks = array->count;
|
|
||||||
logEntry->journal = this;
|
logEntry->journal = this;
|
||||||
|
|
||||||
fEntriesLock.Lock();
|
fEntriesLock.Lock();
|
||||||
@@ -322,7 +323,7 @@ Journal::WriteLogEntry()
|
|||||||
status_t
|
status_t
|
||||||
Journal::FlushLogAndBlocks()
|
Journal::FlushLogAndBlocks()
|
||||||
{
|
{
|
||||||
status_t status = Lock((Transaction *)this);
|
status_t status = fLock.Lock();
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
@@ -335,7 +336,7 @@ Journal::FlushLogAndBlocks()
|
|||||||
}
|
}
|
||||||
status = fVolume->FlushDevice();
|
status = fVolume->FlushDevice();
|
||||||
|
|
||||||
Unlock((Transaction *)this, true);
|
fLock.Unlock();
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user