Lines Matching refs:group

30 // group can span several blocks in the block bitmap, the AllocationBlock
164 # define CHECK_ALLOCATION_GROUP(group) _CheckGroup(group)
166 # define CHECK_ALLOCATION_GROUP(group) ;
178 status_t SetTo(AllocationGroup& group, uint16 block);
179 status_t SetToWritable(Transaction& transaction, AllocationGroup& group,
230 AllocationBlock::SetTo(AllocationGroup& group, uint16 block)
234 // the last group may have less bits than the others
235 if ((block + 1) * fNumBits > group.NumBits())
236 fNumBits = group.NumBits() % fNumBits;
241 return CachedBlock::SetTo(group.Start() + block);
246 AllocationBlock::SetToWritable(Transaction& transaction, AllocationGroup& group,
251 // the last group may have less bits in the last block
252 if ((block + 1) * fNumBits > group.NumBits())
253 fNumBits = group.NumBits() % fNumBits;
258 return CachedBlock::SetToWritable(transaction, group.Start() + block);
372 /*! Allocates the specified run in the allocation group.
383 // Update the allocation group info
441 /*! Frees the specified run in the allocation group.
452 // Update the allocation group info
580 // the last allocation group may contain less blocks than the others
643 // the last allocation group may contain less blocks than the others
654 // finds all free ranges in this allocation group
726 at group \a groupIndex with offset \a start. The resulting allocation
739 FUNCTION_START(("group = %" B_PRId32 ", start = %" B_PRIu16
755 AllocationGroup& group = fGroups[groupIndex];
759 if (start >= group.NumBits() || group.IsFull())
763 // group or already smaller than the minimum
765 if (start < group.fFirstFree)
766 start = group.fFirstFree;
768 if (group.fLargestValid) {
769 if (group.fLargestLength < bestLength)
772 if (group.fLargestStart >= start) {
773 if (group.fLargestLength >= bestLength) {
775 bestStart = group.fLargestStart;
776 bestLength = group.fLargestLength;
782 // We know everything about this group we have to, let's skip
788 // There may be more than one block per allocation group - and
790 // (one allocation can't exceed one allocation group)
799 for (; block < group.NumBlocks(); block++) {
800 if (cached.SetTo(group, block) < B_OK)
803 T(Block("alloc-in", group.Start() + block, cached.Block(),
836 if ((int32)group.NumBits() - currentBit
838 // We can't find a bigger block in this group anymore,
840 block = group.NumBlocks();
859 if (currentBit == (int32)group.NumBits()) {
871 if (canFindGroupLargest && !group.fLargestValid
873 group.fLargestStart = groupLargestStart;
874 group.fLargestLength = groupLargestLength;
875 group.fLargestValid = true;
929 // Files are going in the same allocation group as its parent,
932 uint16 group = parent->AllocationGroup();
934 group += 8;
936 return AllocateBlocks(transaction, group, 0, 1, 1, run);
947 // one block_run can't hold more data than there is in one allocation group
966 uint16 group = inode->BlockRun().AllocationGroup();
983 group = data.direct[last].AllocationGroup();
988 // group as the inode is in but after the inode data
991 // file data will start in the next allocation group
992 group = inode->BlockRun().AllocationGroup() + 1;
995 return AllocateBlocks(transaction, group, start, numBlocks, minimum, run);
1004 int32 group = run.AllocationGroup();
1008 FUNCTION_START(("group = %" B_PRId32 ", start = %" B_PRIu16
1009 ", length = %" B_PRIu16 "\n", group, start, length))
1013 // against the group size (the last group may have a different length)
1014 if (group < 0 || group >= fNumGroups
1015 || start > fGroups[group].NumBits()
1016 || uint32(start + length) > fGroups[group].NumBits()
1020 group, start, length));
1026 if (group < fVolume->Log().AllocationGroup()
1027 || (group == fVolume->Log().AllocationGroup()
1031 group, start, length));
1040 CHECK_ALLOCATION_GROUP(group);
1042 if (fGroups[group].Free(transaction, start, length) != B_OK)
1045 CHECK_ALLOCATION_GROUP(group);
1072 AllocationGroup& group = fGroups[i];
1074 for (uint32 block = 0; block < group.NumBlocks(); block++) {
1077 if (cached.SetToWritable(transaction, group, block) != B_OK)
1098 AllocationGroup& group = fGroups[groupIndex];
1106 for (uint32 block = 0; block < group.NumBlocks(); block++) {
1107 if (cached.SetTo(group, block) < B_OK) {
1108 panic("setting group block %d failed\n", (int)block);
1116 if (!group.fLargestValid) {
1117 if (firstFree >= 0 && firstFree < group.fFirstFree) {
1119 dprintf("group %d first free too late: should be "
1121 (int)group.fFirstFree);
1149 if (firstFree >= 0 && firstFree < group.fFirstFree) {
1151 dprintf("group %d first free too late: should be %d, is %d\n",
1152 (int)groupIndex, (int)firstFree, (int)group.fFirstFree);
1154 if (group.fLargestValid
1155 && (largestStart != group.fLargestStart
1156 || largestLength != group.fLargestLength)) {
1157 panic("bfs %p: group %d largest differs: %d.%d, checked %d.%d.\n",
1158 fVolume, (int)groupIndex, (int)group.fLargestStart,
1159 (int)group.fLargestLength, (int)largestStart, (int)largestLength);
1201 AllocationGroup& group = fGroups[groupIndex];
1203 for (uint32 block = firstBlock; block < group.NumBlocks(); block++) {
1204 cached.SetTo(group, block);
1260 int32 group = start >> fVolume->AllocationGroupShift();
1268 while (groupBlock < fGroups[group].NumBlocks() && length > 0) {
1269 if (cached.SetTo(fGroups[group], groupBlock) != B_OK)
1275 PRINT(("CheckBlocks: Erroneous block (group = %" B_PRId32
1278 group, groupBlock, blockOffset));
1289 if (++groupBlock >= fGroups[group].NumBlocks()) {
1291 group++;
1392 kprintf("blocks per group: %" B_PRId32 "\n", fBlocksPerGroup);
1398 AllocationGroup& group = fGroups[i];
1401 group.NumBits(), &group);
1402 kprintf(" num blocks: %" B_PRIu32 "\n", group.NumBlocks());
1403 kprintf(" start: %" B_PRId32 "\n", group.Start());
1404 kprintf(" first free: %" B_PRId32 "\n", group.fFirstFree);
1405 kprintf(" largest start: %" B_PRId32 "%s\n", group.fLargestStart,
1406 group.fLargestValid ? "" : " (invalid)");
1407 kprintf(" largest length: %" B_PRId32 "\n", group.fLargestLength);
1408 kprintf(" free bits: %" B_PRId32 "\n", group.fFreeBits);
1462 int32 group = -1;
1464 group = parse_expression(argv[2]);
1469 kprintf("usage: %s <ptr-to-volume> [group]\n", argv[0]);
1476 allocator.Dump(group);