Searched refs:btcb (Results 1 - 21 of 21) sorted by relevance

/macosx-10.10/hfs-285/fsck_hfs/dfalib/
H A DSBTree.c43 static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb);
44 static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, UInt16 recordSize);
61 BTreeControlBlock *btcb; local
65 btcb = (BTreeControlBlock*) fcb->fcbBtree;
69 if ( btcb->maxKeyLength == kHFSExtentKeyMaximumLength )
71 else if ( btcb->maxKeyLength == kHFSPlusExtentKeyMaximumLength )
73 else if ( btcb->maxKeyLength == kHFSPlusAttrKeyMaximumLength )
85 result = CheckBTreeKey((BTreeKey *) key, btcb);
88 CopyMemory(key, &searchIterator.key, CalcKeySize(btcb, (BTreeKey *) key)); //�� should we range check against maxkeylen?
90 resultIterator = &btcb
135 BTreeControlBlock *btcb; local
227 BTreeControlBlock *btcb; local
262 BTreeControlBlock *btcb; local
289 BTreeControlBlock *btcb; local
422 BTreeControlBlock *btcb; local
430 CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb) argument
450 ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, UInt16 recordSize) argument
[all...]
H A DBTreeScanner.c78 // btcb->leafRecords may be fragile (the B-Tree header could be damaged)
82 maxLeafRecs = scanState->btcb->fcbPtr->fcbPhysicalSize / sizeof( HFSCatalogThread );
87 err = GetRecordByIndex( scanState->btcb, scanState->currentNodePtr,
158 if ( scanState->nodeNum >= scanState->btcb->totalNodes )
161 scanState->currentNodePtr = (BTNodeDescriptor *)((UInt8 *)scanState->currentNodePtr + scanState->btcb->nodeSize);
168 myBlockDescriptor.blockSize = scanState->btcb->nodeSize;
171 err = hfs_swap_BTNode(&myBlockDescriptor, scanState->btcb->fcbPtr, kSwapBTNodeBigToHost);
214 myBTreeCBPtr = theScanStatePtr->btcb;
294 theScanStatePtr->btcb->nodeSize;
320 BTreeControlBlock *btcb; local
[all...]
H A DBTreeScanner.h51 BTreeControlBlock * btcb; member in struct:BTScanState
H A DSVerify1.c58 static OSErr CheckNodesFirstOffset( SGlobPtr GPtr, BTreeControlBlock *btcb );
611 BTreeControlBlock *btcb; local
719 btcb = (BTreeControlBlock *) vcb->vcbExtentsFile->fcbBtree;
720 btcb->attributes |= kBTBigKeysMask;
1014 BTreeControlBlock * btcb; local
1024 btcb = GPtr->calculatedExtentsBTCB;
1068 btcb->maxKeyLength = kHFSPlusExtentKeyMaximumLength; // max key length
1069 btcb->keyCompareProc = (void *)CompareExtentKeysPlus;
1070 btcb->attributes |=kBTBigKeysMask; // HFS+ Extent files have 16-bit key length
1071 btcb
1362 BTreeControlBlock * btcb; local
2056 BTreeControlBlock * btcb; local
[all...]
H A DBTreePrivate.h153 UInt32 CalcKeySize(const BTreeControlBlock *btcb, const BTreeKey *key);
154 #define CalcKeySize(btcb, key) ( ((btcb)->attributes & kBTBigKeysMask) ? ((key)->length16 + 2) : ((key)->length8 + 1) )
156 UInt32 MaxKeySize(const BTreeControlBlock *btcb);
157 #define MaxKeySize(btcb) ( (btcb)->maxKeyLength + ((btcb)->attributes & kBTBigKeysMask ? 2 : 1))
159 UInt32 KeyLength(const BTreeControlBlock *btcb, const BTreeKey *key);
160 #define KeyLength(btcb, key) ( ((btcb)
[all...]
H A DSControl.c1145 BTreeControlBlock btcb[4]; // 4 btcb's member in struct:ScavStaticStructures
1203 GPtr->calculatedExtentsBTCB = &pointer->btcb[0];
1204 GPtr->calculatedCatalogBTCB = &pointer->btcb[1];
1205 GPtr->calculatedRepairBTCB = &pointer->btcb[2];
1206 GPtr->calculatedAttributesBTCB = &pointer->btcb[3];
1305 BTreeControlBlock *btcb; local
1307 btcb = GPtr->calculatedExtentsBTCB; // calculatedExtentsBTCB
1308 btcb->fcbPtr = GPtr->calculatedExtentsFCB;
1309 btcb
[all...]
H A DSVerify2.c43 static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb );
907 BTreeControlBlock *btcb = GetBTreeControlBlock(fileRefNum); local
908 unsigned char *bitmap = (unsigned char *) ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr;
916 for (nodeNum = 0; nodeNum < btcb->totalNodes; ++nodeNum)
925 err = btcb->getBlockProc(btcb->fcbPtr, nodeNum, kGetBlock, &node);
958 (void) btcb->releaseBlockProc(btcb->fcbPtr, &node, kReleaseBlock);
973 (void) btcb->releaseBlockProc(btcb
[all...]
H A DSUtils.c2108 BTreeControlBlock *btcb; local
2122 btcb = (BTreeControlBlock*) vcb->vcbCatalogFile->fcbBtree;
2123 realFreeNodes = ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount;
2124 items += (2 * btcb->leafRecords) + (btcb->totalNodes - realFreeNodes);
2126 btcb = (BTreeControlBlock*) vcb->vcbExtentsFile->fcbBtree;
2127 realFreeNodes = ((BTreeExtensionsRec*)btcb->refCon)->realFreeNodeCount;
2128 items += btcb->leafRecords + (btcb->totalNodes - realFreeNodes);
2132 btcb
[all...]
H A Dhfs_endian.c196 BTreeControlBlockPtr btcb = fcb->fcbBtree; local
223 if (srcDesc->fLink >= btcb->totalNodes) {
226 if (srcDesc->bLink >= btcb->totalNodes) {
238 if (srcDesc->height > btcb->treeDepth) {
348 if (srcDesc->fLink >= btcb->totalNodes) {
351 if (srcDesc->bLink >= btcb->totalNodes) {
365 if (srcDesc->height > btcb->treeDepth) {
H A DBTree.c51 Inputs: btcb BTree whose key is being copied
58 static void CopyKey(BTreeControlBlockPtr btcb, const BTreeKey *srcKey, BTreeKey *destKey) argument
60 unsigned keySize = CalcKeySize(btcb, srcKey);
61 unsigned maxKeySize = MaxKeySize(btcb);
84 if (btcb->attributes & kBTBigKeysMask)
85 destKey->length16 = btcb->maxKeyLength;
87 destKey->length8 = btcb->maxKeyLength;
H A DBTreeTreeOps.c141 static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb );
1776 static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
1798 GetRecordByIndex( (BTreeControlBlock *)btcb, nodeP, (UInt16) index, &keyPtr, &dataPtr, &dataSize );
1800 if (btcb->attributes & kBTBigKeysMask)
1805 if ( keyLength > btcb->maxKeyLength )
1812 if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 )
H A Ddirhardlink.c40 BTreeControlBlock *btcb; local
47 btcb = (BTreeControlBlock *)fcb->fcbBtree;
104 bcopy(&(result_iterator.key), key, CalcKeySize(btcb, &(result_iterator.key)));
H A DSRepair.c3099 BTreeControlBlock *btcb = GetBTreeControlBlock( kCalculatedCatalogRefNum ); local
3103 CopyMemory( &btcb->lastIterator, &savedIterator, sizeof(BTreeIterator) );
3108 CopyMemory( &savedIterator, &btcb->lastIterator, sizeof(BTreeIterator) );
3111 CopyMemory( &btcb->lastIterator, &savedIterator, sizeof(BTreeIterator) );
6502 BTreeControlBlock *btcb = GetBTreeControlBlock(fileRefNum); local
6503 unsigned char *bitmap = (unsigned char *) ((BTreeExtensionsRec*)btcb->refCon)->BTCBMPtr;
6511 for (nodeNum = 0; nodeNum < btcb->totalNodes; ++nodeNum)
6516 err = btcb->getBlockProc(btcb->fcbPtr, nodeNum, kGetBlock|kGetEmptyBlock, &node);
6527 (void) btcb
[all...]
/macosx-10.10/xnu-2782.1.97/bsd/hfs/hfscommon/BTree/
H A DBTreeScanner.c88 err = GetRecordByIndex( scanState->btcb, scanState->currentNodePtr,
108 if ( scanState->recordsFound >= scanState->btcb->leafRecords )
179 if ( scanState->nodeNum >= scanState->btcb->totalNodes )
189 + scanState->btcb->nodeSize);
196 block.blockSize = scanState->btcb->nodeSize;
200 fref = scanState->btcb->fileRefNum;
254 myBTreeCBPtr = theScanStatePtr->btcb;
285 theScanStatePtr->nodesLeftInBuffer = buf_count(theScanStatePtr->bufferPtr) / theScanStatePtr->btcb->nodeSize;
338 BTreeControlBlock *btcb; local
343 btcb
[all...]
/macosx-10.10/xnu-2782.1.97/bsd/hfs/hfscommon/Misc/
H A DBTreeWrapper.c36 static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb);
37 static Boolean ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, u_int16_t recordSize);
45 BTreeControlBlock *btcb; local
55 btcb = (BTreeControlBlock*) fcb->fcbBTCBPtr;
63 result = CheckBTreeKey((const BTreeKey *) key, btcb);
68 BlockMoveData(key, &iterator->key, CalcKeySize(btcb, (const BTreeKey *) key)); //�� should we range check against maxkeylen?
70 if ( DEBUG_BUILD && !ValidHFSRecord(newData, btcb, dataSize) )
85 static OSErr CheckBTreeKey(const BTreeKey *key, const BTreeControlBlock *btcb) argument
89 if ( btcb->attributes & kBTBigKeysMask )
94 if ( (keyLen < 6) || (keyLen > btcb
105 ValidHFSRecord(const void *record, const BTreeControlBlock *btcb, u_int16_t recordSize) argument
[all...]
/macosx-10.10/xnu-2782.1.97/bsd/hfs/
H A Dhfs_btreeio.c646 BTreeControlBlockPtr btcb = NULL; local
710 MALLOC(btcb, BTreeControlBlock *, sizeof(BTreeControlBlock), M_TEMP, M_WAITOK);
711 bzero(btcb, sizeof(BTreeControlBlock));
713 btcb->nodeSize = nodesize;
714 btcb->maxKeyLength = kHFSPlusAttrKeyMaximumLength;
715 btcb->btreeType = 0xFF;
716 btcb->attributes = kBTVariableIndexKeysMask | kBTBigKeysMask;
717 btcb->version = kBTreeVersion;
718 btcb->writeCount = 1;
719 btcb
[all...]
H A Dhfs_endian.c96 BTreeControlBlockPtr btcb = (BTreeControlBlockPtr)VTOF(vp)->fcbBTCBPtr; local
127 if (btcb->totalNodes != 0) {
128 if (srcDesc->fLink >= btcb->totalNodes) {
129 printf("hfs_swap_BTNode: invalid forward link (0x%08x >= 0x%08x)\n", srcDesc->fLink, btcb->totalNodes);
133 if (srcDesc->bLink >= btcb->totalNodes) {
134 printf("hfs_swap_BTNode: invalid backward link (0x%08x >= 0x%08x)\n", srcDesc->bLink, btcb->totalNodes);
284 if (srcDesc->fLink >= btcb->totalNodes) {
296 if (srcDesc->bLink >= btcb->totalNodes) {
H A Dhfs_search.c346 && myCatPositionPtr->writeCount != myBTScanState.btcb->writeCount) {
347 myCatPositionPtr->writeCount = myBTScanState.btcb->writeCount;
417 myCatPositionPtr->writeCount = myBTScanState.btcb->writeCount;
/macosx-10.10/xnu-2782.1.97/bsd/hfs/hfscommon/headers/
H A DBTreeScanner.h87 BTreeControlBlock * btcb; member in struct:BTScanState
H A DBTreesPrivate.h235 u_int32_t CalcKeySize(const BTreeControlBlock *btcb, const BTreeKey *key);
236 #define CalcKeySize(btcb, key) ( ((btcb)->attributes & kBTBigKeysMask) ? ((key)->length16 + 2) : ((key)->length8 + 1) )
238 u_int32_t KeyLength(const BTreeControlBlock *btcb, const BTreeKey *key);
239 #define KeyLength(btcb, key) ( ((btcb)->attributes & kBTBigKeysMask) ? (key)->length16 : (key)->length8 )
/macosx-10.10/xnu-2782.1.97/bsd/hfs/hfscommon/Catalog/
H A DCatalogUtilities.c144 BTreeControlBlock *btcb; local
155 btcb = (BTreeControlBlock *)fcb->fcbBTCBPtr;
166 BlockMoveData(&searchIterator->key, keyPtr, CalcKeySize(btcb, &searchIterator->key));

Completed in 283 milliseconds