Lines Matching refs:count

164 BlockAllocator::Allocate(uint64 baseHint, uint64 count,
170 count);
179 status_t error = _Allocate(baseHint, fTotalBlocks, count, transaction,
187 error = _Allocate(0, baseHint, count, transaction, &_allocatedBase,
197 BlockAllocator::AllocateExactly(uint64 base, uint64 count,
203 base, count);
206 status_t error = _Allocate(base, fTotalBlocks, count, transaction, NULL,
211 if (allocated < count)
219 BlockAllocator::Free(uint64 base, uint64 count, Transaction& transaction)
223 status_t error = _Free(base, count, transaction);
232 BlockAllocator::ResetFreeBlocks(uint64 count)
236 fFreeBlocks = count;
250 \param count The maximum number of blocks to allocate.
259 BlockAllocator::_Allocate(uint64 base, uint64 searchEnd, uint64 count,
269 uint64 remaining = count;
273 while (count > 0 && base < searchEnd) {
274 uint64 toAllocate = std::min(count, kBlocksPerGroup - groupOffset);
287 count = std::min(count,
290 remaining = count - allocated;
296 count -= toAllocate;
325 if (remaining == count)
328 _allocatedCount = count - remaining;
335 The range specified by \a base and \a count must lie fully within a single
346 \param count The maximum number of blocks to allocate.
355 BlockAllocator::_AllocateInGroup(uint64 base, uint64 searchEnd, uint32 count,
359 base, count);
361 ASSERT(count <= kBlocksPerGroup);
362 ASSERT(base % kBlocksPerGroup + count <= kBlocksPerGroup);
377 uint64 remaining = count;
385 if (_AllocateInBitmapBlock(base, count, transaction,
395 count = std::min(count,
399 remaining = count - allocated;
422 // Clamp the count to allocate, if we have moved the base too far. Do
425 count = std::min(count,
427 remaining = count;
457 if (remaining == count)
460 _allocatedCount = count - remaining;
467 The range specified by \a base and \a count must lie fully within a single
476 \param count The maximum number of blocks to allocate.
485 BlockAllocator::_AllocateInBitmapBlock(uint64 base, uint32 count,
489 ")\n", base, count);
491 ASSERT(count <= kBlocksPerBitmapBlock);
492 ASSERT(base % kBlocksPerBitmapBlock + count <= kBlocksPerBitmapBlock);
546 // Clamp the count to allocate, if we have moved the base too far.
547 if (base % kBlocksPerBitmapBlock + count > kBlocksPerBitmapBlock)
548 count = kBlocksPerBitmapBlock - base % kBlocksPerBitmapBlock;
553 uint32 remaining = count;
576 if (remaining == count)
579 _allocatedCount = count - remaining;
588 BlockAllocator::_Free(uint64 base, uint64 count, Transaction& transaction)
590 if (count == 0)
593 PRINT("BlockAllocator::_Free(%" B_PRIu64 ", %" B_PRIu64 ")\n", base, count);
595 ASSERT(count <= fTotalBlocks - fFreeBlocks);
596 ASSERT(base < fTotalBlocks && fTotalBlocks - base >= count);
599 uint64 remaining = count;
618 BlockAllocator::_FreeInGroup(uint64 base, uint32 count,
621 if (count == 0)
625 base, count);
627 ASSERT(count <= kBlocksPerGroup);
628 ASSERT(base % kBlocksPerGroup + count <= kBlocksPerGroup);
640 uint64 remaining = count;
665 BlockAllocator::_FreeInBitmapBlock(uint64 base, uint32 count,
669 base, count);
671 ASSERT(count <= kBlocksPerBitmapBlock);
672 ASSERT(base % kBlocksPerBitmapBlock + count <= kBlocksPerBitmapBlock);
682 uint32 remaining = count;