* Enhanced cache_blocks_in_main_transaction() to also return the correct number

of blocks in case there is no sub-transaction at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31868 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-07-28 21:47:06 +00:00
parent 4489296bf4
commit 71d2034366

View File

@ -2651,6 +2651,10 @@ cache_blocks_in_transaction(void* _cache, int32 id)
}
/*! Returns the number of blocks that are part of the main transaction. If this
transaction does not have a sub transaction yet, this is the same value as
cache_blocks_in_transaction() would return.
*/
int32
cache_blocks_in_main_transaction(void* _cache, int32 id)
{
@ -2661,7 +2665,10 @@ cache_blocks_in_main_transaction(void* _cache, int32 id)
if (transaction == NULL)
return B_BAD_VALUE;
return transaction->main_num_blocks;
if (transaction->has_sub_transaction)
return transaction->main_num_blocks;
return transaction->num_blocks;
}