Lines Matching defs:extents

47 static u_int32_t CheckExtents( void *extents, u_int32_t blocks, Boolean isHFSPlus );
55 * This function moves the overflow extents associated with srcID into the file associated with dstID.
56 * We should have already verified that 'srcID' has overflow extents. So now we move all of the overflow
64 * Only the source file should have extents, so we just track those.
77 * growing the extents b-tree. Since the move is actually a copy + delete
127 //-- Step 1: Check the catalog nodes for extents
129 //-- locate the source file, test for extents in extent file, and copy the cat record for later
136 //-- Check if there are any extents in the source file
137 //�� I am only checling the extents in the low 32 bits, routine will fail if files extents after 2 gig are in overflow
138 numSrcExtentBlocks = CheckExtents( srcData.hfsPlusFile.dataFork.extents, srcData.hfsPlusFile.dataFork.totalBlocks, isHFSPlus );
139 if ( numSrcExtentBlocks == 0 ) // then check the resource fork extents
140 numSrcExtentBlocks = CheckExtents( srcData.hfsPlusFile.resourceFork.extents, srcData.hfsPlusFile.resourceFork.totalBlocks, isHFSPlus );
142 //-- Check if there are any extents in the destination file
149 numDestExtentBlocks = CheckExtents( destData.hfsPlusFile.dataFork.extents, destData.hfsPlusFile.dataFork.totalBlocks, isHFSPlus );
150 if ( numDestExtentBlocks == 0 ) // then check the resource fork extents
151 numDestExtentBlocks = CheckExtents( destData.hfsPlusFile.resourceFork.extents, destData.hfsPlusFile.resourceFork.totalBlocks, isHFSPlus );
155 //-- Exchange the extents key in the extent file
159 if ( numSrcExtentBlocks && numDestExtentBlocks ) // if both files have extents
161 //-- Change the source extents file ids to our known bogus value
171 //-- Change the destination extents file id's to the source id's
181 err = MoveExtents( vcb, kHFSBogusExtentFileID, srcData.hfsPlusFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
187 //-- Change the bogus extents file id's to the dest id's
197 err = MoveExtents( vcb, srcData.hfsPlusFile.fileID, destData.hfsPlusFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
204 else if ( numSrcExtentBlocks ) // just the source file has extents
218 else if ( numDestExtentBlocks ) // just the destination file has extents
257 //-- Step 1: Check the catalog nodes for extents
259 //-- locate the source file, test for extents in extent file, and copy the cat record for later
266 //-- Check if there are any extents in the source file
268 if ( numSrcExtentBlocks == 0 ) // then check the resource fork extents
275 //-- Check if there are any extents in the destination file
283 if ( numDestExtentBlocks == 0 ) // then check the resource fork extents
291 //-- Exchange the extents key in the extent file
295 if ( numSrcExtentBlocks && numDestExtentBlocks ) // if both files have extents
297 //-- Change the source extents file ids to our known bogus value
312 //-- Change the destination extents file id's to the source id's
322 err = MoveExtents( vcb, kHFSBogusExtentFileID, srcData.hfsFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
328 //-- Change the bogus extents file id's to the dest id's
338 err = MoveExtents( vcb, srcData.hfsFile.fileID, destData.hfsFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
345 else if ( numSrcExtentBlocks ) // just the source file has extents
359 else if ( numDestExtentBlocks ) // just the destination file has extents
540 if ( err == btNotFound ) // Did we run out of extent records in the extents tree?
628 //-- Delete all extents in extent file that have the ID given.
731 // Check if there are extents represented in the extents overflow file.
732 static u_int32_t CheckExtents( void *extents, u_int32_t totalBlocks, Boolean isHFSPlus )
747 extentAllocationBlocks += ((HFSPlusExtentDescriptor *)extents)[i].blockCount;
748 if ( extentAllocationBlocks >= totalBlocks ) // greater than or equal (extents can add past eof if 'Close" crashes w/o truncating new clump)
756 extentAllocationBlocks += ((HFSExtentDescriptor *)extents)[i].blockCount;
757 if ( extentAllocationBlocks >= totalBlocks ) // greater than or equal (extents can add past eof if 'Close" crashes w/o truncating new clump)