Lines Matching refs:base

178 	// search from base hint to end
197 BlockAllocator::AllocateExactly(uint64 base, uint64 count,
203 base, count);
206 status_t error = _Allocate(base, fTotalBlocks, count, transaction, NULL,
219 BlockAllocator::Free(uint64 base, uint64 count, Transaction& transaction)
223 status_t error = _Free(base, count, transaction);
244 If \a _allocatedBase is not \c NULL, the method may move the base up, if it
245 isn't able to allocate anything at the given base.
247 \param base The first potential block to allocate.
251 \param _allocatedBase If not \c NULL, the may allocate at a greater base.
252 The base of the actual allocation is returned via this variable.
259 BlockAllocator::_Allocate(uint64 base, uint64 searchEnd, uint64 count,
262 ASSERT(base <= fTotalBlocks);
265 if (base >= searchEnd || fFreeBlocks == 0)
268 uint64 groupOffset = base % kBlocksPerGroup;
271 // If we're allowed to move the base, loop until we allocate something.
273 while (count > 0 && base < searchEnd) {
277 status_t error = _AllocateInGroup(base, searchEnd, toAllocate,
297 base += toAllocate;
305 // We're not/no longer allowed to move the base. Loop as long as we can
307 while (remaining > 0 && base < searchEnd) {
310 status_t error = _AllocateInGroup(base, searchEnd, toAllocate,
321 base += toAllocate;
335 The range specified by \a base and \a count must lie fully within a single
340 If \a _allocatedBase is not \c NULL, the method may move the base up, if it
341 isn't able to allocate anything at the given base.
343 \param base The first potential block to allocate.
347 \param _allocatedBase If not \c NULL, the may allocate at a greater base.
348 The base of the actual allocation is returned via this variable.
355 BlockAllocator::_AllocateInGroup(uint64 base, uint64 searchEnd, uint32 count,
359 base, count);
362 ASSERT(base % kBlocksPerGroup + count <= kBlocksPerGroup);
364 if (base >= searchEnd)
369 fAllocationGroupBlock + base / kBlocksPerGroup, transaction)) {
375 uint32 blockIndex = base / kBlocksPerBitmapBlock % kBitmapBlocksPerGroup;
376 uint64 inBlockOffset = base % kBlocksPerBitmapBlock;
379 // If we're allowed to move the base, skip used blocks.
385 if (_AllocateInBitmapBlock(base, count, transaction,
403 base += kBlocksPerBitmapBlock - inBlockOffset;
410 while (blockIndex < kBitmapBlocksPerGroup && base < searchEnd) {
414 base += kBlocksPerBitmapBlock;
422 // Clamp the count to allocate, if we have moved the base too far. Do
426 kBlocksPerGroup - (uint32)base % kBlocksPerGroup);
432 while (remaining > 0 && base < searchEnd) {
440 status_t error = _AllocateInBitmapBlock(base, toAllocate, transaction,
451 base += allocated;
467 The range specified by \a base and \a count must lie fully within a single
472 If \a _allocatedBase is not \c NULL, the method may move the base up, if it
473 isn't able to allocate anything at the given base.
475 \param base The first potential block to allocate.
477 \param _allocatedBase If not \c NULL, the may allocate at a greater base.
478 The base of the actual allocation is returned via this variable.
485 BlockAllocator::_AllocateInBitmapBlock(uint64 base, uint32 count,
489 ")\n", base, count);
492 ASSERT(base % kBlocksPerBitmapBlock + count <= kBlocksPerBitmapBlock);
496 fBitmapBlock + base / kBlocksPerBitmapBlock, transaction)) {
501 + base % kBlocksPerBitmapBlock / 32;
503 uint32 bitOffset = base % 32;
505 // If we're allowed to move the base, skip used blocks.
514 base++;
520 base += 32 - bitOffset;
532 base++;
539 base += 32;
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;
551 // Allocate as many of the requested blocks as we can, starting at the base
581 *_allocatedBase = base;
588 BlockAllocator::_Free(uint64 base, uint64 count, Transaction& transaction)
593 PRINT("BlockAllocator::_Free(%" B_PRIu64 ", %" B_PRIu64 ")\n", base, count);
596 ASSERT(base < fTotalBlocks && fTotalBlocks - base >= count);
598 uint64 groupOffset = base % kBlocksPerGroup;
603 status_t error = _FreeInGroup(base, toFree, transaction);
609 base += toFree;
618 BlockAllocator::_FreeInGroup(uint64 base, uint32 count,
625 base, count);
628 ASSERT(base % kBlocksPerGroup + count <= kBlocksPerGroup);
632 fAllocationGroupBlock + base / kBlocksPerGroup, transaction)) {
638 uint32 blockIndex = base / kBlocksPerBitmapBlock % kBitmapBlocksPerGroup;
639 uint64 inBlockOffset = base % kBlocksPerBitmapBlock;
649 status_t error = _FreeInBitmapBlock(base, toFree, transaction);
655 base += toFree;
665 BlockAllocator::_FreeInBitmapBlock(uint64 base, uint32 count,
669 base, count);
672 ASSERT(base % kBlocksPerBitmapBlock + count <= kBlocksPerBitmapBlock);
676 fBitmapBlock + base / kBlocksPerBitmapBlock, transaction)) {
680 uint32* bits = (uint32*)block.Data() + base % kBlocksPerBitmapBlock / 32;
681 uint32 bitOffset = base % 32;