* 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:
parent
4489296bf4
commit
71d2034366
9
src/system/kernel/cache/block_cache.cpp
vendored
9
src/system/kernel/cache/block_cache.cpp
vendored
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user