• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/hfs-285/fsck_hfs/dfalib/

Lines Matching refs:segment

26  * partially full.  If a segment does not exist in the tree, it
28 * 1. Full if the coresponding segment map bit is set
79 UInt32* gFullBitmapSegment; /* points to a FULL bitmap segment*/
80 UInt32* gEmptyBitmapSegment; /* points to an EMPTY bitmap segment*/
90 UInt32 segment;
105 static BMS_Node * BMS_Lookup(UInt32 segment);
106 static BMS_Node * BMS_Insert(UInt32 segment, int segmentType);
107 static BMS_Node * BMS_Delete(UInt32 segment);
184 plog(" %d full segments, %d segment nodes (max depth was %d nodes)\n",
204 * Description: Return bitmap segment corresponding to given startBit.
206 * 1. Calculate the segment number for given bit.
207 * 2. If the segment exists in full segment list,
209 * a. Remove segment from full segment list.
210 * b. Insert a full segment in the bitmap tree.
211 * Else return pointer to dummy full segment
212 * 3. If segment found in tree, it is partially full. Return it.
213 * 4. If (2) and (3) are not true, it is a empty segment.
215 * a. Insert empty segment in the bitmap tree.
216 * Else return pointer to dummy empty segment.
220 * 2. buffer - pointer to return pointer to bitmap segment
221 * 3. bitOperation - intent for new segment
227 * 1. buffer - pointer to desired segment
232 UInt32 segment;
236 segment = startBit / kBitsPerSegment;
239 if (bit_test(gFullSegmentList, segment)) {
241 bit_clear(gFullSegmentList, segment);
243 if ((segNode = BMS_Insert(segment, kFullSegment)) != NULL)
248 // for a partially full segment..
249 } else if ((segNode = BMS_Lookup(segment)) != NULL) {
252 // for an empty segment...
255 if ((segNode = BMS_Insert(segment, kEmptySegment)) != NULL)
263 plog("GetSegmentBitmap: couldn't get a node for block %d, segment %d\n", startBit, segment);
271 plog(" segment %d: L=0x%08x, R=0x%08x \n< ",
272 (int)segNode->segment, (int)segNode->left, segNode->right);
282 plog("*** segment %d (start blk %d) is already full!\n", segment, startBit);
286 plog("*** segment %d (start blk %d) is already empty!\n", segment, startBit);
296 * Description: Test if the current bitmap segment is a full
297 * segment or empty segment.
298 * If full segment, delete the segment, set corresponding full segment
300 * If empty list, delete the segment from list. Note that we update
304 * startBit - startBit of segment to test
311 UInt32 segment;
314 segment = startBit / kBitsPerSegment;
316 if (bit_test(gFullSegmentList, segment))
319 if ((segNode = BMS_Lookup(segment)) != NULL) {
330 if (segment != 0 && bcmp(&segNode->bitmap[0], gFullBitmapSegment, kBytesPerSegment) == 0) {
331 if (BMS_Delete(segment) != NULL) {
332 bit_set(gFullSegmentList, segment);
339 if (segment != 0 && bcmp(&segNode->bitmap[0], gEmptyBitmapSegment, kBytesPerSegment) == 0) {
340 if (BMS_Delete(segment) != NULL) {
363 * 5. For 2, 3, and 4, call TestSegmentBitmap after writing one segment or
364 * setting all bits to optimize full and empty segment list.
367 * startBit - bit number in segment bitmap to start set operation.
398 * Get the bitmap segment containing the first word to check
446 /* See if it's time to move to the next bitmap segment */
448 startBit += kBitsPerSegment; // generate a bit in the next bitmap segment
517 * 5. For 2, 3, and 4, call TestSegmentBitmap after writing one segment or
518 * clearing all bits to optimize full and empty segment list.
521 * startBit - bit number in segment bitmap to start clear operation.
552 * Get the bitmap segment containing the first word to check
600 /* See if it's time to move to the next bitmap segment */
602 startBit += kBitsPerSegment; // generate a bit in the next bitmap segment
750 plog("start block number for segment = %qu\n", bit);
751 plog("segment %qd\n", bit / kBitsPerSegment);
770 /* Compare each word in the segment */
838 * blocks of the volume are intialized to zero in the last bitmap segment.
840 * the last bitmap segment.
861 /* All bits in segment are set */
867 /* All bits in segment are clear */
914 * The function takes care if the last bitmap segment is paritally used
937 UInt32 validBitsInSegment; /* valid bits remaining (considering totalBits) in segment */
943 * is always total number of bits represented by the segment
956 /* If this is last segment, calculate valid bits remaining */
961 /* All bits in segment are set */
969 /* All bits in segment are clear */
976 * total number of blocks represented in one free segment, include
977 * entire segment in our count
979 * total number of blocks represented in one free segment, include
1001 /* If this is the last segment, check if the current word
1036 } /* for - segment is partially full */
1166 * There are no free blocks in this segment, so trim any previous
1167 * extent (that ended at the end of the previous segment).
1180 * This entire segment is free. Add it to a previous extent, or
1196 * If we get here, the current segment has some free and some used
1270 * partially full. If a segment does not exist in the tree, it
1272 * 1. Full if the coresponding segment map bit is set
1302 BMS_Lookup(UInt32 segment)
1306 while (ptree && ptree->segment != segment) {
1308 if (segment > ptree->segment)
1322 register UInt32 segment;
1324 segment = NewEntry->segment;
1332 if (segment > ptree->segment) { /* walk the right sub-tree */
1354 /* insert a new segment into the tree */
1356 BMS_Insert(UInt32 segment, int segmentType)
1371 new->segment = segment;
1385 BMS_Delete(UInt32 segment)
1393 if (seg_found->segment == segment)
1396 while (seg_found && seg_found->segment != segment) {
1398 if (segment > seg_found->segment)
1485 plog("seg %d\n", root->segment);