• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/xnu-2782.1.97/bsd/hfs/hfscommon/Catalog/

Lines Matching defs:extents

47 static u_int32_t CheckExtents( void *extents, u_int32_t blocks, Boolean isHFSPlus );
59 * This function moves the overflow extents associated with srcID into the file associated with dstID.
60 * We should have already verified that 'srcID' has overflow extents. So now we move all of the overflow
68 * Only the source file should have extents, so we just track those.
81 * growing the extents b-tree. Since the move is actually a copy + delete
131 //-- Step 1: Check the catalog nodes for extents
133 //-- locate the source file, test for extents in extent file, and copy the cat record for later
140 //-- Check if there are any extents in the source file
141 //�� I am only checling the extents in the low 32 bits, routine will fail if files extents after 2 gig are in overflow
142 numSrcExtentBlocks = CheckExtents( srcData.hfsPlusFile.dataFork.extents, srcData.hfsPlusFile.dataFork.totalBlocks, isHFSPlus );
143 if ( numSrcExtentBlocks == 0 ) // then check the resource fork extents
144 numSrcExtentBlocks = CheckExtents( srcData.hfsPlusFile.resourceFork.extents, srcData.hfsPlusFile.resourceFork.totalBlocks, isHFSPlus );
146 //-- Check if there are any extents in the destination file
153 numDestExtentBlocks = CheckExtents( destData.hfsPlusFile.dataFork.extents, destData.hfsPlusFile.dataFork.totalBlocks, isHFSPlus );
154 if ( numDestExtentBlocks == 0 ) // then check the resource fork extents
155 numDestExtentBlocks = CheckExtents( destData.hfsPlusFile.resourceFork.extents, destData.hfsPlusFile.resourceFork.totalBlocks, isHFSPlus );
159 //-- Exchange the extents key in the extent file
163 if ( numSrcExtentBlocks && numDestExtentBlocks ) // if both files have extents
165 //-- Change the source extents file ids to our known bogus value
182 //-- Change the destination extents file id's to the source id's
192 err = MoveExtents( vcb, kHFSBogusExtentFileID, srcData.hfsPlusFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
204 //-- Change the bogus extents file id's to the dest id's
214 err = MoveExtents( vcb, srcData.hfsPlusFile.fileID, destData.hfsPlusFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
221 else if ( numSrcExtentBlocks ) // just the source file has extents
235 else if ( numDestExtentBlocks ) // just the destination file has extents
275 //-- Step 1: Check the catalog nodes for extents
277 //-- locate the source file, test for extents in extent file, and copy the cat record for later
284 //-- Check if there are any extents in the source file
286 if ( numSrcExtentBlocks == 0 ) // then check the resource fork extents
293 //-- Check if there are any extents in the destination file
301 if ( numDestExtentBlocks == 0 ) // then check the resource fork extents
309 //-- Exchange the extents key in the extent file
313 if ( numSrcExtentBlocks && numDestExtentBlocks ) // if both files have extents
315 //-- Change the source extents file ids to our known bogus value
330 //-- Change the destination extents file id's to the source id's
340 err = MoveExtents( vcb, kHFSBogusExtentFileID, srcData.hfsFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
346 //-- Change the bogus extents file id's to the dest id's
356 err = MoveExtents( vcb, srcData.hfsFile.fileID, destData.hfsFile.fileID, 0, 0, isHFSPlus ); // Move the extents back
363 else if ( numSrcExtentBlocks ) // just the source file has extents
377 else if ( numDestExtentBlocks ) // just the destination file has extents
567 if ( err == btNotFound ) // Did we run out of extent records in the extents tree?
666 //-- Delete all extents in extent file that have the ID given.
781 // Check if there are extents represented in the extents overflow file.
782 static u_int32_t CheckExtents( void *extents, u_int32_t totalBlocks, Boolean isHFSPlus )
797 extentAllocationBlocks += ((HFSPlusExtentDescriptor *)extents)[i].blockCount;
798 if ( extentAllocationBlocks >= totalBlocks ) // greater than or equal (extents can add past eof if 'Close" crashes w/o truncating new clump)
807 extentAllocationBlocks += ((HFSExtentDescriptor *)extents)[i].blockCount;
808 if ( extentAllocationBlocks >= totalBlocks ) // greater than or equal (extents can add past eof if 'Close" crashes w/o truncating new clump)