* 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:
+7
@@ -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
|
int32
|
||||||
cache_blocks_in_main_transaction(void* _cache, int32 id)
|
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)
|
if (transaction == NULL)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
if (transaction->has_sub_transaction)
|
||||||
return transaction->main_num_blocks;
|
return transaction->main_num_blocks;
|
||||||
|
|
||||||
|
return transaction->num_blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user