|
@ -15,11 +15,9 @@ Subject: Rename custom macro nil with NULL |
|
|
fsck_hfs.tproj/dfalib/SVerify2.c | 4 +- |
|
|
fsck_hfs.tproj/dfalib/SVerify2.c | 4 +- |
|
|
10 files changed, 177 insertions(+), 177 deletions(-) |
|
|
10 files changed, 177 insertions(+), 177 deletions(-) |
|
|
|
|
|
|
|
|
diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c
|
|
|
|
|
|
index 7ad9fe0..c0c8744 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTree.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTree.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTree.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTree.c
|
|
|
@@ -163,21 +163,21 @@ OSStatus BTInitialize (FCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -163,21 +163,21 @@ OSStatus BTInitialize (FCB *filePtr
|
|
|
|
|
|
|
|
|
////////////////////// Preliminary Error Checking /////////////////////////// |
|
|
////////////////////// Preliminary Error Checking /////////////////////////// |
|
|
|
|
|
|
|
@ -48,7 +46,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
if ((maxKeyLength == 0) || |
|
|
if ((maxKeyLength == 0) || |
|
|
(maxKeyLength > kMaxKeyLength)) return fsBTInvalidKeyLengthErr; |
|
|
(maxKeyLength > kMaxKeyLength)) return fsBTInvalidKeyLengthErr; |
|
|
@@ -209,7 +209,7 @@ OSStatus BTInitialize (FCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -209,7 +209,7 @@ OSStatus BTInitialize (FCB *filePtr
|
|
|
//////////////////////// Allocate Control Block ///////////////////////////// |
|
|
//////////////////////// Allocate Control Block ///////////////////////////// |
|
|
|
|
|
|
|
|
M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); |
|
|
M_RESIDENT_ALLOCATE_FIXED_CLEAR( &btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); |
|
@ -57,7 +55,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
err = memFullErr; |
|
|
err = memFullErr; |
|
|
goto ErrorExit; |
|
|
goto ErrorExit; |
|
|
@@ -220,7 +220,7 @@ OSStatus BTInitialize (FCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -220,7 +220,7 @@ OSStatus BTInitialize (FCB *filePtr
|
|
|
btreePtr->flags = 0; |
|
|
btreePtr->flags = 0; |
|
|
btreePtr->attributes = 0; |
|
|
btreePtr->attributes = 0; |
|
|
btreePtr->forkPtr = forkPtr; |
|
|
btreePtr->forkPtr = forkPtr; |
|
@ -66,7 +64,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
btreePtr->keyDescPtr = keyDescPtr; |
|
|
btreePtr->keyDescPtr = keyDescPtr; |
|
|
btreePtr->btreeType = btreeType; |
|
|
btreePtr->btreeType = btreeType; |
|
|
btreePtr->treeDepth = 0; |
|
|
btreePtr->treeDepth = 0; |
|
|
@@ -282,7 +282,7 @@ OSStatus BTInitialize (FCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -282,7 +282,7 @@ OSStatus BTInitialize (FCB *filePtr
|
|
|
|
|
|
|
|
|
///////////////////// Copy Key Descriptor To Header ///////////////////////// |
|
|
///////////////////// Copy Key Descriptor To Header ///////////////////////// |
|
|
#if SupportsKeyDescriptors |
|
|
#if SupportsKeyDescriptors |
|
@ -75,7 +73,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
err = CheckKeyDescriptor (keyDescPtr, maxKeyLength); |
|
|
err = CheckKeyDescriptor (keyDescPtr, maxKeyLength); |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
@@ -309,7 +309,7 @@ OSStatus BTInitialize (FCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -309,7 +309,7 @@ OSStatus BTInitialize (FCB *filePtr
|
|
|
err = UpdateHeader (btreePtr); |
|
|
err = UpdateHeader (btreePtr); |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
|
|
|
|
|
@ -84,7 +82,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); |
|
|
M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); |
|
|
|
|
|
|
|
|
return noErr; |
|
|
return noErr; |
|
|
@@ -320,7 +320,7 @@ OSStatus BTInitialize (FCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -320,7 +320,7 @@ OSStatus BTInitialize (FCB *filePtr
|
|
|
ErrorExit: |
|
|
ErrorExit: |
|
|
|
|
|
|
|
|
(void) ReleaseNode (btreePtr, &headerNode); |
|
|
(void) ReleaseNode (btreePtr, &headerNode); |
|
@ -93,7 +91,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); |
|
|
M_RESIDENT_DEALLOCATE_FIXED( btreePtr, sizeof( BTreeControlBlock ), kFSBTreeControlBlockType ); |
|
|
|
|
|
|
|
|
return err; |
|
|
return err; |
|
|
@@ -342,7 +342,7 @@ Input: filePtr - pointer to file to open as a B-tree
|
|
|
|
|
|
|
|
|
@@ -342,7 +342,7 @@ Input: filePtr - pointer to file to
|
|
|
setEndOfForkProc - pointer to client's SetEOF function |
|
|
setEndOfForkProc - pointer to client's SetEOF function |
|
|
|
|
|
|
|
|
Result: noErr - success |
|
|
Result: noErr - success |
|
@ -102,7 +100,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
fsBTInvalidFileErr - |
|
|
fsBTInvalidFileErr - |
|
|
memFullErr - |
|
|
memFullErr - |
|
|
!= noErr - failure |
|
|
!= noErr - failure |
|
|
@@ -364,16 +364,16 @@ OSStatus BTOpenPath (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -364,16 +364,16 @@ OSStatus BTOpenPath (SFCB *filePtr
|
|
|
|
|
|
|
|
|
////////////////////// Preliminary Error Checking /////////////////////////// |
|
|
////////////////////// Preliminary Error Checking /////////////////////////// |
|
|
|
|
|
|
|
@ -125,7 +123,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
return noErr; |
|
|
return noErr; |
|
|
|
|
|
|
|
|
// is file large enough to contain header node? |
|
|
// is file large enough to contain header node? |
|
|
@@ -384,7 +384,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -384,7 +384,7 @@ OSStatus BTOpenPath (SFCB *filePtr
|
|
|
//////////////////////// Allocate Control Block ///////////////////////////// |
|
|
//////////////////////// Allocate Control Block ///////////////////////////// |
|
|
|
|
|
|
|
|
btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) ); |
|
|
btreePtr = (BTreeControlBlock*) AllocateClearMemory( sizeof( BTreeControlBlock ) ); |
|
@ -134,7 +132,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
Panic ("\pBTOpen: no memory for btreePtr."); |
|
|
Panic ("\pBTOpen: no memory for btreePtr."); |
|
|
return memFullErr; |
|
|
return memFullErr; |
|
|
@@ -397,7 +397,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -397,7 +397,7 @@ OSStatus BTOpenPath (SFCB *filePtr
|
|
|
|
|
|
|
|
|
/////////////////////////// Read Header Node //////////////////////////////// |
|
|
/////////////////////////// Read Header Node //////////////////////////////// |
|
|
|
|
|
|
|
@ -143,7 +141,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
btreePtr->fcbPtr = filePtr; |
|
|
btreePtr->fcbPtr = filePtr; |
|
|
filePtr->fcbBtree = (void *) btreePtr; // attach btree cb to file |
|
|
filePtr->fcbBtree = (void *) btreePtr; // attach btree cb to file |
|
|
@@ -487,7 +487,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -487,7 +487,7 @@ OSStatus BTOpenPath (SFCB *filePtr
|
|
|
|
|
|
|
|
|
////////////////////////// Get Key Descriptor /////////////////////////////// |
|
|
////////////////////////// Get Key Descriptor /////////////////////////////// |
|
|
#if SupportsKeyDescriptors |
|
|
#if SupportsKeyDescriptors |
|
@ -152,7 +150,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
err = GetKeyDescriptor (btreePtr, nodeRec.buffer); //¥¥ it should check amount of memory allocated... |
|
|
err = GetKeyDescriptor (btreePtr, nodeRec.buffer); //¥¥ it should check amount of memory allocated... |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
@@ -499,7 +499,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -499,7 +499,7 @@ OSStatus BTOpenPath (SFCB *filePtr
|
|
|
else |
|
|
else |
|
|
#endif |
|
|
#endif |
|
|
{ |
|
|
{ |
|
@ -161,7 +159,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
err = ReleaseNode (btreePtr, &nodeRec); |
|
|
err = ReleaseNode (btreePtr, &nodeRec); |
|
|
@@ -528,7 +528,7 @@ OSStatus BTOpenPath (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -528,7 +528,7 @@ OSStatus BTOpenPath (SFCB *filePtr
|
|
|
|
|
|
|
|
|
ErrorExit: |
|
|
ErrorExit: |
|
|
|
|
|
|
|
@ -170,7 +168,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
(void) ReleaseNode (btreePtr, &nodeRec); |
|
|
(void) ReleaseNode (btreePtr, &nodeRec); |
|
|
DisposeMemory( btreePtr ); |
|
|
DisposeMemory( btreePtr ); |
|
|
|
|
|
|
|
|
@@ -567,7 +567,7 @@ OSStatus BTClosePath (SFCB *filePtr)
|
|
|
|
|
|
|
|
|
@@ -567,7 +567,7 @@ OSStatus BTClosePath (SFCB *filePt
|
|
|
|
|
|
|
|
|
btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; |
|
|
btreePtr = (BTreeControlBlockPtr) filePtr->fcbBtree; |
|
|
|
|
|
|
|
@ -179,7 +177,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
return fsBTInvalidFileErr; |
|
|
return fsBTInvalidFileErr; |
|
|
|
|
|
|
|
|
////////////////////// Check for other BTree Paths ////////////////////////// |
|
|
////////////////////// Check for other BTree Paths ////////////////////////// |
|
|
@@ -603,14 +603,14 @@ OSStatus BTClosePath (SFCB *filePtr)
|
|
|
|
|
|
|
|
|
@@ -603,14 +603,14 @@ OSStatus BTClosePath (SFCB *filePt
|
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
|
|
|
|
|
|
#if SupportsKeyDescriptors |
|
|
#if SupportsKeyDescriptors |
|
@ -196,7 +194,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
// LogEndTime(kTraceCloseBTree, noErr); |
|
|
// LogEndTime(kTraceCloseBTree, noErr); |
|
|
|
|
|
|
|
|
@@ -643,7 +643,7 @@ Function: Search for position in B*Tree indicated by searchKey. If a valid node
|
|
|
|
|
|
|
|
|
@@ -643,7 +643,7 @@ Function: Search for position in B*Tree
|
|
|
|
|
|
|
|
|
Input: pathPtr - pointer to path for BTree file. |
|
|
Input: pathPtr - pointer to path for BTree file. |
|
|
searchKey - pointer to search key to match. |
|
|
searchKey - pointer to search key to match. |
|
@ -205,7 +203,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
Output: record - pointer to BufferDescriptor containing record |
|
|
Output: record - pointer to BufferDescriptor containing record |
|
|
recordLen - length of data at recordPtr |
|
|
recordLen - length of data at recordPtr |
|
|
@@ -678,14 +678,14 @@ OSStatus BTSearchRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -678,14 +678,14 @@ OSStatus BTSearchRecord (SFCB *fil
|
|
|
|
|
|
|
|
|
// LogStartTime(kTraceSearchBTree); |
|
|
// LogStartTime(kTraceSearchBTree); |
|
|
|
|
|
|
|
@ -224,7 +222,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
err = CheckKey (&searchIterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength); |
|
|
err = CheckKey (&searchIterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength); |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
@@ -775,9 +775,9 @@ OSStatus BTSearchRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -775,9 +775,9 @@ OSStatus BTSearchRecord (SFCB *fil
|
|
|
//¥¥ Should check for errors! Or BlockMove could choke on recordPtr!!! |
|
|
//¥¥ Should check for errors! Or BlockMove could choke on recordPtr!!! |
|
|
GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len); |
|
|
GetRecordByIndex (btreePtr, node.buffer, index, &keyPtr, &recordPtr, &len); |
|
|
|
|
|
|
|
@ -236,7 +234,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
ByteCount recordSize; |
|
|
ByteCount recordSize; |
|
|
|
|
|
|
|
|
@@ -794,7 +794,7 @@ OSStatus BTSearchRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -794,7 +794,7 @@ OSStatus BTSearchRecord (SFCB *fil
|
|
|
|
|
|
|
|
|
/////////////////////// Success - Update Iterator /////////////////////////// |
|
|
/////////////////////// Success - Update Iterator /////////////////////////// |
|
|
|
|
|
|
|
@ -245,7 +243,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
resultIterator->hint.writeCount = btreePtr->writeCount; |
|
|
resultIterator->hint.writeCount = btreePtr->writeCount; |
|
|
resultIterator->hint.nodeNum = nodeNum; |
|
|
resultIterator->hint.nodeNum = nodeNum; |
|
|
@@ -825,10 +825,10 @@ OSStatus BTSearchRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -825,10 +825,10 @@ OSStatus BTSearchRecord (SFCB *fil
|
|
|
|
|
|
|
|
|
ErrorExit: |
|
|
ErrorExit: |
|
|
|
|
|
|
|
@ -258,7 +256,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
resultIterator->hint.writeCount = 0; |
|
|
resultIterator->hint.writeCount = 0; |
|
|
resultIterator->hint.nodeNum = 0; |
|
|
resultIterator->hint.nodeNum = 0; |
|
|
@@ -892,18 +892,18 @@ OSStatus BTIterateRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -892,18 +892,18 @@ OSStatus BTIterateRecord (SFCB *fi
|
|
|
|
|
|
|
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
|
|
|
|
|
@ -282,7 +280,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
return fsBTInvalidFileErr; //¥¥ handle properly |
|
|
return fsBTInvalidFileErr; //¥¥ handle properly |
|
|
} |
|
|
} |
|
|
@@ -968,7 +968,7 @@ OSStatus BTIterateRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -968,7 +968,7 @@ OSStatus BTIterateRecord (SFCB *fi
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -291,7 +289,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
nodeNum = ((NodeDescPtr) node.buffer)->bLink; |
|
|
nodeNum = ((NodeDescPtr) node.buffer)->bLink; |
|
|
if ( nodeNum > 0) |
|
|
if ( nodeNum > 0) |
|
|
@@ -981,13 +981,13 @@ OSStatus BTIterateRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -981,13 +981,13 @@ OSStatus BTIterateRecord (SFCB *fi
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// Before we stomp on "right", we'd better release it if needed |
|
|
// Before we stomp on "right", we'd better release it if needed |
|
@ -307,7 +305,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
index = ((NodeDescPtr) node.buffer)->numRecords -1; |
|
|
index = ((NodeDescPtr) node.buffer)->numRecords -1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1012,7 +1012,7 @@ OSStatus BTIterateRecord (SFCB *fi
|
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -316,7 +314,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
nodeNum = ((NodeDescPtr) node.buffer)->fLink; |
|
|
nodeNum = ((NodeDescPtr) node.buffer)->fLink; |
|
|
if ( nodeNum > 0) |
|
|
if ( nodeNum > 0) |
|
|
@@ -1025,13 +1025,13 @@ OSStatus BTIterateRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1025,13 +1025,13 @@ OSStatus BTIterateRecord (SFCB *fi
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// Before we stomp on "left", we'd better release it if needed |
|
|
// Before we stomp on "left", we'd better release it if needed |
|
@ -382,7 +380,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
iterator->hint.writeCount = 0; |
|
|
iterator->hint.writeCount = 0; |
|
|
iterator->hint.nodeNum = 0; |
|
|
iterator->hint.nodeNum = 0; |
|
|
@@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1157,7 +1157,7 @@ OSStatus BTInsertRecord (SFCB *fil
|
|
|
|
|
|
|
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
|
|
|
|
|
@ -391,7 +389,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
err = CheckInsertParams (filePtr, iterator, record, recordLen); |
|
|
err = CheckInsertParams (filePtr, iterator, record, recordLen); |
|
|
if (err != noErr) |
|
|
if (err != noErr) |
|
|
@@ -1317,7 +1317,7 @@ OSStatus BTSetRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1317,7 +1317,7 @@ OSStatus BTSetRecord (SFCB *fileP
|
|
|
|
|
|
|
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
|
|
|
|
|
@ -400,7 +398,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
err = CheckInsertParams (filePtr, iterator, record, recordLen); |
|
|
err = CheckInsertParams (filePtr, iterator, record, recordLen); |
|
|
if (err != noErr) |
|
|
if (err != noErr) |
|
|
@@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1506,7 +1506,7 @@ OSStatus BTReplaceRecord (SFCB *fi
|
|
|
|
|
|
|
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
|
|
|
|
|
@ -409,7 +407,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
err = CheckInsertParams (filePtr, iterator, record, recordLen); |
|
|
err = CheckInsertParams (filePtr, iterator, record, recordLen); |
|
|
if (err != noErr) |
|
|
if (err != noErr) |
|
|
@@ -1645,20 +1645,20 @@ OSStatus BTDeleteRecord (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1645,20 +1645,20 @@ OSStatus BTDeleteRecord (SFCB *fil
|
|
|
|
|
|
|
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
////////////////////////// Priliminary Checks /////////////////////////////// |
|
|
|
|
|
|
|
@ -435,7 +433,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
{ |
|
|
{ |
|
|
err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength); |
|
|
err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength); |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
@@ -1712,12 +1712,12 @@ OSStatus BTGetInformation (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1712,12 +1712,12 @@ OSStatus BTGetInformation (SFCB *fil
|
|
|
BTreeControlBlockPtr btreePtr; |
|
|
BTreeControlBlockPtr btreePtr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -451,7 +449,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
//¥¥ check version? |
|
|
//¥¥ check version? |
|
|
|
|
|
|
|
|
@@ -1730,7 +1730,7 @@ OSStatus BTGetInformation (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -1730,7 +1730,7 @@ OSStatus BTGetInformation (SFCB *fil
|
|
|
info->keyDescriptor = btreePtr->keyDescPtr; //¥¥ this won't do at all... |
|
|
info->keyDescriptor = btreePtr->keyDescPtr; //¥¥ this won't do at all... |
|
|
info->reserved = 0; |
|
|
info->reserved = 0; |
|
|
|
|
|
|
|
@ -460,7 +458,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
info->keyDescLength = 0; |
|
|
info->keyDescLength = 0; |
|
|
else |
|
|
else |
|
|
info->keyDescLength = (UInt32) btreePtr->keyDescPtr->length; |
|
|
info->keyDescLength = (UInt32) btreePtr->keyDescPtr->length; |
|
|
@@ -1762,11 +1762,11 @@ OSStatus BTFlushPath (SFCB *filePtr)
|
|
|
|
|
|
|
|
|
@@ -1762,11 +1762,11 @@ OSStatus BTFlushPath (SFCB *fileP
|
|
|
|
|
|
|
|
|
// LogStartTime(kTraceFlushBTree); |
|
|
// LogStartTime(kTraceFlushBTree); |
|
|
|
|
|
|
|
@ -474,7 +472,7 @@ index 7ad9fe0..c0c8744 100644 |
|
|
|
|
|
|
|
|
err = UpdateHeader (btreePtr); |
|
|
err = UpdateHeader (btreePtr); |
|
|
|
|
|
|
|
|
@@ -1788,13 +1788,13 @@ Input: iterator - pointer to BTreeIterator
|
|
|
|
|
|
|
|
|
@@ -1788,13 +1788,13 @@ Input: iterator - pointer to BTreeItera
|
|
|
Output: iterator - iterator with the hint.nodeNum cleared |
|
|
Output: iterator - iterator with the hint.nodeNum cleared |
|
|
|
|
|
|
|
|
Result: noErr - success |
|
|
Result: noErr - success |
|
@ -490,11 +488,9 @@ index 7ad9fe0..c0c8744 100644 |
|
|
return paramErr; |
|
|
return paramErr; |
|
|
|
|
|
|
|
|
iterator->hint.nodeNum = 0; |
|
|
iterator->hint.nodeNum = 0; |
|
|
diff --git a/fsck_hfs.tproj/dfalib/BTreeAllocate.c b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
|
|
|
|
|
|
index 485d867..02bdd8d 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeAllocate.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeAllocate.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeAllocate.c
|
|
|
@@ -83,7 +83,7 @@ OSStatus AllocateNode (BTreeControlBlockPtr btreePtr, UInt32 *nodeNum)
|
|
|
|
|
|
|
|
|
@@ -83,7 +83,7 @@ OSStatus AllocateNode (BTreeControlBlock
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nodeNumber = 0; // first node number of header map record |
|
|
nodeNumber = 0; // first node number of header map record |
|
@ -503,7 +499,7 @@ index 485d867..02bdd8d 100644 |
|
|
// - and for ErrorExit |
|
|
// - and for ErrorExit |
|
|
|
|
|
|
|
|
while (true) |
|
|
while (true) |
|
|
@@ -192,7 +192,7 @@ OSStatus FreeNode (BTreeControlBlockPtr btreePtr, UInt32 nodeNum)
|
|
|
|
|
|
|
|
|
@@ -192,7 +192,7 @@ OSStatus FreeNode (BTreeControlBlockPtr
|
|
|
|
|
|
|
|
|
//////////////////////////// Find Map Record //////////////////////////////// |
|
|
//////////////////////////// Find Map Record //////////////////////////////// |
|
|
nodeIndex = 0; // first node number of header map record |
|
|
nodeIndex = 0; // first node number of header map record |
|
@ -512,7 +508,7 @@ index 485d867..02bdd8d 100644 |
|
|
|
|
|
|
|
|
while (nodeNum >= nodeIndex) |
|
|
while (nodeNum >= nodeIndex) |
|
|
{ |
|
|
{ |
|
|
@@ -278,8 +278,8 @@ OSStatus ExtendBTree (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -278,8 +278,8 @@ OSStatus ExtendBTree (BTreeControlBlockP
|
|
|
nodeSize = btreePtr->nodeSize; |
|
|
nodeSize = btreePtr->nodeSize; |
|
|
filePtr = btreePtr->fcbPtr; |
|
|
filePtr = btreePtr->fcbPtr; |
|
|
|
|
|
|
|
@ -532,7 +528,7 @@ index 485d867..02bdd8d 100644 |
|
|
node is retrieved. |
|
|
node is retrieved. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -474,7 +474,7 @@ OSStatus GetMapNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -474,7 +474,7 @@ OSStatus GetMapNode (BTreeControlBlockPt
|
|
|
UInt16 mapIndex; |
|
|
UInt16 mapIndex; |
|
|
UInt32 nextNodeNum; |
|
|
UInt32 nextNodeNum; |
|
|
|
|
|
|
|
@ -550,11 +546,9 @@ index 485d867..02bdd8d 100644 |
|
|
*mapSize = 0; |
|
|
*mapSize = 0; |
|
|
|
|
|
|
|
|
return err; |
|
|
return err; |
|
|
diff --git a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
|
|
|
|
|
|
index 7c9edca..997f34b 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeMiscOps.c
|
|
|
@@ -236,13 +236,13 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -236,13 +236,13 @@ OSStatus FindIteratorPosition (BTreeCont
|
|
|
// assume index points to UInt16 |
|
|
// assume index points to UInt16 |
|
|
// assume foundRecord points to Boolean |
|
|
// assume foundRecord points to Boolean |
|
|
|
|
|
|
|
@ -572,7 +566,7 @@ index 7c9edca..997f34b 100644 |
|
|
{ |
|
|
{ |
|
|
err = fsBTInvalidIteratorErr; |
|
|
err = fsBTInvalidIteratorErr; |
|
|
goto ErrorExit; |
|
|
goto ErrorExit; |
|
|
@@ -250,7 +250,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -250,7 +250,7 @@ OSStatus FindIteratorPosition (BTreeCont
|
|
|
|
|
|
|
|
|
#if SupportsKeyDescriptors |
|
|
#if SupportsKeyDescriptors |
|
|
//¥¥ verify iterator key (change CheckKey to take btreePtr instead of keyDescPtr?) |
|
|
//¥¥ verify iterator key (change CheckKey to take btreePtr instead of keyDescPtr?) |
|
@ -581,7 +575,7 @@ index 7c9edca..997f34b 100644 |
|
|
{ |
|
|
{ |
|
|
err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength ); |
|
|
err = CheckKey (&iterator->key, btreePtr->keyDescPtr, btreePtr->maxKeyLength ); |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
@@ -309,7 +309,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -309,7 +309,7 @@ OSStatus FindIteratorPosition (BTreeCont
|
|
|
{ |
|
|
{ |
|
|
*right = *middle; |
|
|
*right = *middle; |
|
|
*middle = *left; |
|
|
*middle = *left; |
|
@ -590,7 +584,7 @@ index 7c9edca..997f34b 100644 |
|
|
index = leftIndex; |
|
|
index = leftIndex; |
|
|
|
|
|
|
|
|
goto SuccessfulExit; |
|
|
goto SuccessfulExit; |
|
|
@@ -330,7 +330,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -330,7 +330,7 @@ OSStatus FindIteratorPosition (BTreeCont
|
|
|
{ |
|
|
{ |
|
|
*right = *middle; |
|
|
*right = *middle; |
|
|
*middle = *left; |
|
|
*middle = *left; |
|
@ -599,7 +593,7 @@ index 7c9edca..997f34b 100644 |
|
|
index = leftIndex; |
|
|
index = leftIndex; |
|
|
|
|
|
|
|
|
goto SuccessfulExit; |
|
|
goto SuccessfulExit; |
|
|
@@ -363,7 +363,7 @@ OSStatus FindIteratorPosition (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -363,7 +363,7 @@ OSStatus FindIteratorPosition (BTreeCont
|
|
|
{ |
|
|
{ |
|
|
*left = *middle; |
|
|
*left = *middle; |
|
|
*middle = *right; |
|
|
*middle = *right; |
|
@ -608,7 +602,7 @@ index 7c9edca..997f34b 100644 |
|
|
index = rightIndex; |
|
|
index = rightIndex; |
|
|
|
|
|
|
|
|
goto SuccessfulExit; |
|
|
goto SuccessfulExit; |
|
|
@@ -427,15 +427,15 @@ OSStatus CheckInsertParams (SFCB *filePtr,
|
|
|
|
|
|
|
|
|
@@ -427,15 +427,15 @@ OSStatus CheckInsertParams (SFCB *
|
|
|
{ |
|
|
{ |
|
|
BTreeControlBlockPtr btreePtr; |
|
|
BTreeControlBlockPtr btreePtr; |
|
|
|
|
|
|
|
@ -629,11 +623,9 @@ index 7c9edca..997f34b 100644 |
|
|
{ |
|
|
{ |
|
|
OSStatus err; |
|
|
OSStatus err; |
|
|
|
|
|
|
|
|
diff --git a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
|
|
|
|
|
|
index da07cc7..ef2bd7b 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeNodeOps.c
|
|
|
@@ -105,7 +105,7 @@ Function: Gets an existing BTree node from FS Agent and verifies it.
|
|
|
|
|
|
|
|
|
@@ -105,7 +105,7 @@ Function: Gets an existing BTree node fr
|
|
|
Input: btreePtr - pointer to BTree control block |
|
|
Input: btreePtr - pointer to BTree control block |
|
|
nodeNum - number of node to request |
|
|
nodeNum - number of node to request |
|
|
|
|
|
|
|
@ -642,7 +634,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
|
|
|
|
|
|
Result: |
|
|
Result: |
|
|
noErr - success |
|
|
noErr - success |
|
|
@@ -139,7 +139,7 @@ OSStatus GetNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -139,7 +139,7 @@ OSStatus GetNode (BTreeControlBlockPtr
|
|
|
if (err != noErr) |
|
|
if (err != noErr) |
|
|
{ |
|
|
{ |
|
|
Panic ("\pGetNode: getNodeProc returned error."); |
|
|
Panic ("\pGetNode: getNodeProc returned error."); |
|
@ -651,7 +643,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
goto ErrorExit; |
|
|
goto ErrorExit; |
|
|
} |
|
|
} |
|
|
++btreePtr->numGetNodes; |
|
|
++btreePtr->numGetNodes; |
|
|
@@ -156,8 +156,8 @@ OSStatus GetNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -156,8 +156,8 @@ OSStatus GetNode (BTreeControlBlockPtr
|
|
|
return noErr; |
|
|
return noErr; |
|
|
|
|
|
|
|
|
ErrorExit: |
|
|
ErrorExit: |
|
@ -662,7 +654,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
|
|
|
|
|
|
// LogEndTime(kTraceGetNode, err); |
|
|
// LogEndTime(kTraceGetNode, err); |
|
|
|
|
|
|
|
|
@@ -176,7 +176,7 @@ Function: Gets a new BTree node from FS Agent and initializes it to an empty
|
|
|
|
|
|
|
|
|
@@ -176,7 +176,7 @@ Function: Gets a new BTree node from FS
|
|
|
Input: btreePtr - pointer to BTree control block |
|
|
Input: btreePtr - pointer to BTree control block |
|
|
nodeNum - number of node to request |
|
|
nodeNum - number of node to request |
|
|
|
|
|
|
|
@ -671,7 +663,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
|
|
|
|
|
|
Result: noErr - success |
|
|
Result: noErr - success |
|
|
!= noErr - failure |
|
|
!= noErr - failure |
|
|
@@ -203,7 +203,7 @@ OSStatus GetNewNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -203,7 +203,7 @@ OSStatus GetNewNode (BTreeControlBlockPt
|
|
|
if (err != noErr) |
|
|
if (err != noErr) |
|
|
{ |
|
|
{ |
|
|
Panic ("\pGetNewNode: getNodeProc returned error."); |
|
|
Panic ("\pGetNewNode: getNodeProc returned error."); |
|
@ -680,7 +672,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
return err; |
|
|
return err; |
|
|
} |
|
|
} |
|
|
++btreePtr->numGetNewNodes; |
|
|
++btreePtr->numGetNewNodes; |
|
|
@@ -248,7 +248,7 @@ OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -248,7 +248,7 @@ OSStatus ReleaseNode (BTreeControlBlockP
|
|
|
|
|
|
|
|
|
err = noErr; |
|
|
err = noErr; |
|
|
|
|
|
|
|
@ -689,7 +681,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
{ |
|
|
{ |
|
|
/* |
|
|
/* |
|
|
* The nodes must remain in the cache as big endian! |
|
|
* The nodes must remain in the cache as big endian! |
|
|
@@ -267,8 +267,8 @@ OSStatus ReleaseNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -267,8 +267,8 @@ OSStatus ReleaseNode (BTreeControlBlockP
|
|
|
++btreePtr->numReleaseNodes; |
|
|
++btreePtr->numReleaseNodes; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -700,7 +692,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
|
|
|
|
|
|
// LogEndTime(kTraceReleaseNode, err); |
|
|
// LogEndTime(kTraceReleaseNode, err); |
|
|
|
|
|
|
|
|
@@ -299,7 +299,7 @@ OSStatus TrashNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -299,7 +299,7 @@ OSStatus TrashNode (BTreeControlBlockPtr
|
|
|
|
|
|
|
|
|
err = noErr; |
|
|
err = noErr; |
|
|
|
|
|
|
|
@ -709,7 +701,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
{ |
|
|
{ |
|
|
releaseNodeProc = btreePtr->releaseBlockProc; |
|
|
releaseNodeProc = btreePtr->releaseBlockProc; |
|
|
err = releaseNodeProc (btreePtr->fcbPtr, |
|
|
err = releaseNodeProc (btreePtr->fcbPtr, |
|
|
@@ -309,8 +309,8 @@ OSStatus TrashNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -309,8 +309,8 @@ OSStatus TrashNode (BTreeControlBlockPtr
|
|
|
++btreePtr->numReleaseNodes; |
|
|
++btreePtr->numReleaseNodes; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -720,7 +712,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
|
|
|
|
|
|
return err; |
|
|
return err; |
|
|
} |
|
|
} |
|
|
@@ -338,7 +338,7 @@ OSStatus UpdateNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -338,7 +338,7 @@ OSStatus UpdateNode (BTreeControlBlockPt
|
|
|
|
|
|
|
|
|
err = noErr; |
|
|
err = noErr; |
|
|
|
|
|
|
|
@ -729,7 +721,7 @@ index da07cc7..ef2bd7b 100644 |
|
|
{ |
|
|
{ |
|
|
// LogStartTime(kTraceReleaseNode); |
|
|
// LogStartTime(kTraceReleaseNode); |
|
|
err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig); |
|
|
err = hfs_swap_BTNode(nodePtr, btreePtr->fcbPtr, kSwapBTNodeHostToBig); |
|
|
@@ -358,8 +358,8 @@ OSStatus UpdateNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -358,8 +358,8 @@ OSStatus UpdateNode (BTreeControlBlockPt
|
|
|
++btreePtr->numUpdateNodes; |
|
|
++btreePtr->numUpdateNodes; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -740,11 +732,9 @@ index da07cc7..ef2bd7b 100644 |
|
|
|
|
|
|
|
|
return noErr; |
|
|
return noErr; |
|
|
|
|
|
|
|
|
diff --git a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
|
|
|
|
|
|
index 37fb170..73e1fda 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/BTreeTreeOps.c
|
|
|
@@ -177,7 +177,7 @@ Output: nodeNum - number of the node containing the key position
|
|
|
|
|
|
|
|
|
@@ -177,7 +177,7 @@ Output: nodeNum - number of the node
|
|
|
|
|
|
|
|
|
Result: noErr - key found, index is record index |
|
|
Result: noErr - key found, index is record index |
|
|
fsBTRecordNotFoundErr - key not found, index is insert index |
|
|
fsBTRecordNotFoundErr - key not found, index is insert index |
|
@ -764,7 +754,7 @@ index 37fb170..73e1fda 100644 |
|
|
*returnIndex = 0; |
|
|
*returnIndex = 0; |
|
|
|
|
|
|
|
|
return err; |
|
|
return err; |
|
|
@@ -354,7 +354,7 @@ OSStatus InsertTree ( BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -354,7 +354,7 @@ OSStatus InsertTree ( BTreeControlBlockP
|
|
|
primaryKey.replacingKey = replacingKey; |
|
|
primaryKey.replacingKey = replacingKey; |
|
|
primaryKey.skipRotate = false; |
|
|
primaryKey.skipRotate = false; |
|
|
|
|
|
|
|
@ -773,7 +763,7 @@ index 37fb170..73e1fda 100644 |
|
|
targetNode, index, level, insertNode ); |
|
|
targetNode, index, level, insertNode ); |
|
|
|
|
|
|
|
|
return err; |
|
|
return err; |
|
|
@@ -385,7 +385,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -385,7 +385,7 @@ OSStatus InsertLevel (BTreeControlBlockP
|
|
|
#if defined(applec) && !defined(__SC__) |
|
|
#if defined(applec) && !defined(__SC__) |
|
|
PanicIf ((level == 1) && (((NodeDescPtr)targetNode->buffer)->kind != kBTLeafNode), "\P InsertLevel: non-leaf at level 1! "); |
|
|
PanicIf ((level == 1) && (((NodeDescPtr)targetNode->buffer)->kind != kBTLeafNode), "\P InsertLevel: non-leaf at level 1! "); |
|
|
#endif |
|
|
#endif |
|
@ -782,7 +772,7 @@ index 37fb170..73e1fda 100644 |
|
|
targetNodeNum = treePathTable [level].node; |
|
|
targetNodeNum = treePathTable [level].node; |
|
|
|
|
|
|
|
|
insertParent = false; |
|
|
insertParent = false; |
|
|
@@ -420,7 +420,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -420,7 +420,7 @@ OSStatus InsertLevel (BTreeControlBlockP
|
|
|
|
|
|
|
|
|
////// process second insert (if any) ////// |
|
|
////// process second insert (if any) ////// |
|
|
|
|
|
|
|
@ -791,7 +781,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
Boolean temp; |
|
|
Boolean temp; |
|
|
|
|
|
|
|
|
@@ -446,7 +446,7 @@ OSStatus InsertLevel (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -446,7 +446,7 @@ OSStatus InsertLevel (BTreeControlBlockP
|
|
|
UInt8 * recPtr; |
|
|
UInt8 * recPtr; |
|
|
UInt16 recSize; |
|
|
UInt16 recSize; |
|
|
|
|
|
|
|
@ -800,7 +790,7 @@ index 37fb170..73e1fda 100644 |
|
|
|
|
|
|
|
|
PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?"); |
|
|
PanicIf ( (level == btreePtr->treeDepth), "InsertLevel: unfinished insert!?"); |
|
|
|
|
|
|
|
|
@@ -606,9 +606,9 @@ static OSErr InsertNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -606,9 +606,9 @@ static OSErr InsertNode (BTreeControlBlo
|
|
|
|
|
|
|
|
|
if ( leftNodeNum > 0 ) |
|
|
if ( leftNodeNum > 0 ) |
|
|
{ |
|
|
{ |
|
@ -812,7 +802,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
err = GetNode (btreePtr, leftNodeNum, siblingNode); // will be released by caller or a split below |
|
|
err = GetNode (btreePtr, leftNodeNum, siblingNode); // will be released by caller or a split below |
|
|
M_ExitOnError (err); |
|
|
M_ExitOnError (err); |
|
|
@@ -703,7 +703,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -703,7 +703,7 @@ OSStatus DeleteTree (BTreeControlBlock
|
|
|
|
|
|
|
|
|
targetNodeNum = treePathTable[level].node; |
|
|
targetNodeNum = treePathTable[level].node; |
|
|
targetNodePtr = targetNode->buffer; |
|
|
targetNodePtr = targetNode->buffer; |
|
@ -821,7 +811,7 @@ index 37fb170..73e1fda 100644 |
|
|
|
|
|
|
|
|
DeleteRecord (btreePtr, targetNodePtr, index); |
|
|
DeleteRecord (btreePtr, targetNodePtr, index); |
|
|
|
|
|
|
|
|
@@ -766,7 +766,7 @@ OSStatus DeleteTree (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -766,7 +766,7 @@ OSStatus DeleteTree (BTreeControlBlock
|
|
|
deleteRequired = false; |
|
|
deleteRequired = false; |
|
|
updateRequired = false; |
|
|
updateRequired = false; |
|
|
|
|
|
|
|
@ -830,7 +820,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
btreePtr->rootNode = 0; |
|
|
btreePtr->rootNode = 0; |
|
|
btreePtr->treeDepth = 0; |
|
|
btreePtr->treeDepth = 0; |
|
|
@@ -1124,7 +1124,7 @@ static OSStatus SplitLeft (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -1124,7 +1124,7 @@ static OSStatus SplitLeft (BTreeControl
|
|
|
if ( (right->height == 1) && (right->kind != kBTLeafNode) ) |
|
|
if ( (right->height == 1) && (right->kind != kBTLeafNode) ) |
|
|
return fsBTInvalidNodeErr; |
|
|
return fsBTInvalidNodeErr; |
|
|
|
|
|
|
|
@ -839,7 +829,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
if ( left->fLink != rightNodeNum ) |
|
|
if ( left->fLink != rightNodeNum ) |
|
|
return fsBTInvalidNodeErr; //¥¥ E_BadSibling ? |
|
|
return fsBTInvalidNodeErr; //¥¥ E_BadSibling ? |
|
|
@@ -1145,7 +1145,7 @@ static OSStatus SplitLeft (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -1145,7 +1145,7 @@ static OSStatus SplitLeft (BTreeControl
|
|
|
|
|
|
|
|
|
/////////////// Update Forward Link In Original Left Node /////////////////// |
|
|
/////////////// Update Forward Link In Original Left Node /////////////////// |
|
|
|
|
|
|
|
@ -848,7 +838,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
left->fLink = newNodeNum; |
|
|
left->fLink = newNodeNum; |
|
|
err = UpdateNode (btreePtr, leftNode); |
|
|
err = UpdateNode (btreePtr, leftNode); |
|
|
@@ -1240,8 +1240,8 @@ static OSStatus AddNewRootNode (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -1240,8 +1240,8 @@ static OSStatus AddNewRootNode (BTreeCon
|
|
|
Boolean didItFit; |
|
|
Boolean didItFit; |
|
|
UInt16 keyLength; |
|
|
UInt16 keyLength; |
|
|
|
|
|
|
|
@ -859,7 +849,7 @@ index 37fb170..73e1fda 100644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////// Initialize New Root Node //////////////////////////// |
|
|
/////////////////////// Initialize New Root Node //////////////////////////// |
|
|
@@ -1362,7 +1362,7 @@ static OSStatus SplitRight (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -1362,7 +1362,7 @@ static OSStatus SplitRight (BTreeContro
|
|
|
if ( (leftPtr->height == 1) && (leftPtr->kind != kBTLeafNode) ) |
|
|
if ( (leftPtr->height == 1) && (leftPtr->kind != kBTLeafNode) ) |
|
|
return fsBTInvalidNodeErr; |
|
|
return fsBTInvalidNodeErr; |
|
|
|
|
|
|
|
@ -868,7 +858,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
if ( rightPtr->bLink != nodeNum ) |
|
|
if ( rightPtr->bLink != nodeNum ) |
|
|
return fsBTInvalidNodeErr; //¥¥ E_BadSibling ? |
|
|
return fsBTInvalidNodeErr; //¥¥ E_BadSibling ? |
|
|
@@ -1382,7 +1382,7 @@ static OSStatus SplitRight (BTreeControlBlockPtr btreePtr,
|
|
|
|
|
|
|
|
|
@@ -1382,7 +1382,7 @@ static OSStatus SplitRight (BTreeContro
|
|
|
|
|
|
|
|
|
/////////////// Update backward Link In Original Right Node /////////////////// |
|
|
/////////////// Update backward Link In Original Right Node /////////////////// |
|
|
|
|
|
|
|
@ -877,7 +867,7 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
rightPtr->bLink = newNodeNum; |
|
|
rightPtr->bLink = newNodeNum; |
|
|
err = UpdateNode (btreePtr, rightNodePtr); |
|
|
err = UpdateNode (btreePtr, rightNodePtr); |
|
|
@@ -1739,7 +1739,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
|
|
|
|
|
|
|
|
|
@@ -1739,7 +1739,7 @@ static int DoKeyCheck( NodeDescPtr nodeP
|
|
|
UInt16 keyLength; |
|
|
UInt16 keyLength; |
|
|
KeyPtr keyPtr; |
|
|
KeyPtr keyPtr; |
|
|
UInt8 *dataPtr; |
|
|
UInt8 *dataPtr; |
|
@ -886,7 +876,7 @@ index 37fb170..73e1fda 100644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( nodeP->numRecords == 0 ) |
|
|
if ( nodeP->numRecords == 0 ) |
|
|
@@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP, BTreeControlBlock *btcb )
|
|
|
|
|
|
|
|
|
@@ -1766,7 +1766,7 @@ static int DoKeyCheck( NodeDescPtr nodeP
|
|
|
return( -1 ); |
|
|
return( -1 ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -895,11 +885,9 @@ index 37fb170..73e1fda 100644 |
|
|
{ |
|
|
{ |
|
|
if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 ) |
|
|
if ( CompareKeys( (BTreeControlBlockPtr)btcb, prevkeyP, keyPtr ) >= 0 ) |
|
|
{ |
|
|
{ |
|
|
diff --git a/fsck_hfs.tproj/dfalib/SControl.c b/fsck_hfs.tproj/dfalib/SControl.c
|
|
|
|
|
|
index 8b03ece..d3145e0 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/SControl.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/SControl.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SControl.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SControl.c
|
|
|
@@ -82,7 +82,7 @@ CheckHFS( int fsReadRef, int fsWriteRef, int checkLevel, int repairLevel,
|
|
|
|
|
|
|
|
|
@@ -82,7 +82,7 @@ CheckHFS( int fsReadRef, int fsWriteRef
|
|
|
{ |
|
|
{ |
|
|
SGlob dataArea; // Allocate the scav globals |
|
|
SGlob dataArea; // Allocate the scav globals |
|
|
short temp; |
|
|
short temp; |
|
@ -1056,7 +1044,7 @@ index 8b03ece..d3145e0 100644 |
|
|
|
|
|
|
|
|
return( noErr ); |
|
|
return( noErr ); |
|
|
} |
|
|
} |
|
|
@@ -1113,7 +1113,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
|
|
|
|
|
|
|
|
|
@@ -1113,7 +1113,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr
|
|
|
// Now look at the name of the Driver name. If it is .BlueBoxShared keep it out of the list of available disks. |
|
|
// Now look at the name of the Driver name. If it is .BlueBoxShared keep it out of the list of available disks. |
|
|
driverDCtlHandle = GetDCtlEntry(dqPtr->dQRefNum); |
|
|
driverDCtlHandle = GetDCtlEntry(dqPtr->dQRefNum); |
|
|
driverDCtlPtr = *driverDCtlHandle; |
|
|
driverDCtlPtr = *driverDCtlHandle; |
|
@ -1065,7 +1053,7 @@ index 8b03ece..d3145e0 100644 |
|
|
{ |
|
|
{ |
|
|
if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0) |
|
|
if (((driverDCtlPtr->dCtlFlags) & Is_Ram_Based_Mask) == 0) |
|
|
{ |
|
|
{ |
|
|
@@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
|
|
|
|
|
|
|
|
|
@@ -1127,19 +1127,19 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
driverName = (StringPtr)&(drvrHeaderPtr->drvrName); |
|
|
driverName = (StringPtr)&(drvrHeaderPtr->drvrName); |
|
@ -1089,7 +1077,7 @@ index 8b03ece..d3145e0 100644 |
|
|
paramBlock.ioVRefNum = dqPtr->dQDrive; |
|
|
paramBlock.ioVRefNum = dqPtr->dQDrive; |
|
|
paramBlock.ioCRefNum = dqPtr->dQRefNum; |
|
|
paramBlock.ioCRefNum = dqPtr->dQRefNum; |
|
|
paramBlock.csCode = kDriveIcon; // return physical icon |
|
|
paramBlock.csCode = kDriveIcon; // return physical icon |
|
|
@@ -1152,7 +1152,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr dqPtr )
|
|
|
|
|
|
|
|
|
@@ -1152,7 +1152,7 @@ Boolean IsBlueBoxSharedDrive ( DrvQElPtr
|
|
|
|
|
|
|
|
|
iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam; |
|
|
iconAndStringRecPtr = * (IconAndStringRecPtr*) & paramBlock.csParam; |
|
|
whereStringPtr = (StringPtr) & iconAndStringRecPtr->string; |
|
|
whereStringPtr = (StringPtr) & iconAndStringRecPtr->string; |
|
@ -1098,11 +1086,9 @@ index 8b03ece..d3145e0 100644 |
|
|
{ |
|
|
{ |
|
|
return( true ); |
|
|
return( true ); |
|
|
} |
|
|
} |
|
|
diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
|
|
|
|
|
|
index 89c12d6..b261c37 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/SRepair.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/SRepair.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SRepair.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SRepair.c
|
|
|
@@ -844,7 +844,7 @@ static int DelFThd( SGlobPtr GPtr, UInt32 fid ) // the file ID
|
|
|
|
|
|
|
|
|
@@ -844,7 +844,7 @@ static int DelFThd( SGlobPtr GPtr, UInt3
|
|
|
|
|
|
|
|
|
isHFSPlus = VolumeObjectIsHFSPlus( ); |
|
|
isHFSPlus = VolumeObjectIsHFSPlus( ); |
|
|
|
|
|
|
|
@ -1111,7 +1097,7 @@ index 89c12d6..b261c37 100644 |
|
|
result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint ); |
|
|
result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint ); |
|
|
|
|
|
|
|
|
if ( result ) return ( IntError( GPtr, result ) ); |
|
|
if ( result ) return ( IntError( GPtr, result ) ); |
|
|
@@ -910,7 +910,7 @@ static OSErr FixDirThread( SGlobPtr GPtr, UInt32 did ) // the dir ID
|
|
|
|
|
|
|
|
|
@@ -910,7 +910,7 @@ static OSErr FixDirThread( SGlobPtr GPtr
|
|
|
|
|
|
|
|
|
isHFSPlus = VolumeObjectIsHFSPlus( ); |
|
|
isHFSPlus = VolumeObjectIsHFSPlus( ); |
|
|
|
|
|
|
|
@ -1120,7 +1106,7 @@ index 89c12d6..b261c37 100644 |
|
|
result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint ); |
|
|
result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &record, &recSize, &hint ); |
|
|
|
|
|
|
|
|
if ( result ) |
|
|
if ( result ) |
|
|
@@ -2171,7 +2171,7 @@ static OSErr FixOrphanedFiles ( SGlobPtr GPtr )
|
|
|
|
|
|
|
|
|
@@ -2171,7 +2171,7 @@ static OSErr FixOrphanedFiles ( SGlobPtr
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//-- Build the key for the file thread |
|
|
//-- Build the key for the file thread |
|
@ -1129,8 +1115,6 @@ index 89c12d6..b261c37 100644 |
|
|
|
|
|
|
|
|
err = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, |
|
|
err = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, |
|
|
&tempKey, &threadRecord, &recordSize, &hint2 ); |
|
|
&tempKey, &threadRecord, &recordSize, &hint2 ); |
|
|
diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c
|
|
|
|
|
|
index 6e9253e..491afbf 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/SUtils.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/SUtils.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SUtils.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SUtils.c
|
|
|
@@ -395,11 +395,11 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
|
|
|
@@ -395,11 +395,11 @@ OSErr GetVolumeFeatures( SGlobPtr GPtr )
|
|
@ -1147,7 +1131,7 @@ index 6e9253e..491afbf 100644 |
|
|
pb.ioParam.ioVRefNum = GPtr->realVCB->vcbVRefNum; |
|
|
pb.ioParam.ioVRefNum = GPtr->realVCB->vcbVRefNum; |
|
|
pb.ioParam.ioBuffer = (Ptr) &buffer; |
|
|
pb.ioParam.ioBuffer = (Ptr) &buffer; |
|
|
pb.ioParam.ioReqCount = sizeof( buffer ); |
|
|
pb.ioParam.ioReqCount = sizeof( buffer ); |
|
|
@@ -2282,7 +2282,7 @@ void print_prime_buckets(PrimeBuckets *cur);
|
|
|
|
|
|
|
|
|
@@ -2282,7 +2282,7 @@ void print_prime_buckets(PrimeBuckets *c
|
|
|
* 4. btreetye - can be kHFSPlusCatalogRecord or kHFSPlusAttributeRecord |
|
|
* 4. btreetye - can be kHFSPlusCatalogRecord or kHFSPlusAttributeRecord |
|
|
* indicates which btree prime number bucket should be incremented |
|
|
* indicates which btree prime number bucket should be incremented |
|
|
* |
|
|
* |
|
@ -1156,11 +1140,9 @@ index 6e9253e..491afbf 100644 |
|
|
*/ |
|
|
*/ |
|
|
void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype) |
|
|
void RecordXAttrBits(SGlobPtr GPtr, UInt16 flags, HFSCatalogNodeID fileid, UInt16 btreetype) |
|
|
{ |
|
|
{ |
|
|
diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
|
|
|
|
|
|
index 39bda5c..c33155f 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/SVerify1.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/SVerify1.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SVerify1.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SVerify1.c
|
|
|
@@ -790,13 +790,13 @@ OSErr CreateExtentsBTreeControlBlock( SGlobPtr GPtr )
|
|
|
|
|
|
|
|
|
@@ -790,13 +790,13 @@ OSErr CreateExtentsBTreeControlBlock( SG
|
|
|
// set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes. |
|
|
// set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes. |
|
|
// |
|
|
// |
|
|
btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions |
|
|
btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions |
|
@ -1176,7 +1158,7 @@ index 39bda5c..c33155f 100644 |
|
|
{ |
|
|
{ |
|
|
err = R_NoMem; |
|
|
err = R_NoMem; |
|
|
goto exit; |
|
|
goto exit; |
|
|
@@ -1145,13 +1145,13 @@ OSErr CreateCatalogBTreeControlBlock( SGlobPtr GPtr )
|
|
|
|
|
|
|
|
|
@@ -1145,13 +1145,13 @@ OSErr CreateCatalogBTreeControlBlock( SG
|
|
|
// |
|
|
// |
|
|
|
|
|
|
|
|
btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions |
|
|
btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions |
|
@ -1210,7 +1192,7 @@ index 39bda5c..c33155f 100644 |
|
|
result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint ); |
|
|
result = SearchBTreeRecord( GPtr->calculatedCatalogFCB, &key, kNoHint, &foundKey, &threadRecord, &recSize, &hint ); |
|
|
if ( result != noErr ) { |
|
|
if ( result != noErr ) { |
|
|
char idStr[16]; |
|
|
char idStr[16]; |
|
|
@@ -1780,26 +1780,26 @@ OSErr CreateAttributesBTreeControlBlock( SGlobPtr GPtr )
|
|
|
|
|
|
|
|
|
@@ -1780,26 +1780,26 @@ OSErr CreateAttributesBTreeControlBlock(
|
|
|
// set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes. |
|
|
// set up our DFA extended BTCB area. Will we have enough memory on all HFS+ volumes. |
|
|
// |
|
|
// |
|
|
btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions |
|
|
btcb->refCon = AllocateClearMemory( sizeof(BTreeExtensionsRec) ); // allocate space for our BTCB extensions |
|
@ -1241,7 +1223,7 @@ index 39bda5c..c33155f 100644 |
|
|
{ |
|
|
{ |
|
|
err = R_NoMem; |
|
|
err = R_NoMem; |
|
|
goto exit; |
|
|
goto exit; |
|
|
@@ -2358,7 +2358,7 @@ static OSErr RcdMDBEmbededVolDescriptionErr( SGlobPtr GPtr, OSErr type, HFSMaste
|
|
|
|
|
|
|
|
|
@@ -2358,7 +2358,7 @@ static OSErr RcdMDBEmbededVolDescription
|
|
|
RcdError( GPtr, type ); // first, record the error |
|
|
RcdError( GPtr, type ); // first, record the error |
|
|
|
|
|
|
|
|
p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) ); // get the node |
|
|
p = AllocMinorRepairOrder( GPtr, sizeof(EmbededVolDescription) ); // get the node |
|
@ -1250,7 +1232,7 @@ index 39bda5c..c33155f 100644 |
|
|
|
|
|
|
|
|
p->type = type; // save error info |
|
|
p->type = type; // save error info |
|
|
desc = (EmbededVolDescription *) &(p->name); |
|
|
desc = (EmbededVolDescription *) &(p->name); |
|
|
@@ -2397,7 +2397,7 @@ static OSErr RcdInvalidWrapperExtents( SGlobPtr GPtr, OSErr type )
|
|
|
|
|
|
|
|
|
@@ -2397,7 +2397,7 @@ static OSErr RcdInvalidWrapperExtents( S
|
|
|
RcdError( GPtr, type ); // first, record the error |
|
|
RcdError( GPtr, type ); // first, record the error |
|
|
|
|
|
|
|
|
p = AllocMinorRepairOrder( GPtr, 0 ); // get the node |
|
|
p = AllocMinorRepairOrder( GPtr, 0 ); // get the node |
|
@ -1259,7 +1241,7 @@ index 39bda5c..c33155f 100644 |
|
|
|
|
|
|
|
|
p->type = type; // save error info |
|
|
p->type = type; // save error info |
|
|
|
|
|
|
|
|
@@ -3029,7 +3029,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
|
|
|
|
|
|
|
|
|
@@ -3029,7 +3029,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
|
|
|
foundBadExtent = false; |
|
|
foundBadExtent = false; |
|
|
lastExtentIndex = GPtr->numExtents; |
|
|
lastExtentIndex = GPtr->numExtents; |
|
|
|
|
|
|
|
@ -1268,7 +1250,7 @@ index 39bda5c..c33155f 100644 |
|
|
{ |
|
|
{ |
|
|
// checkout the extent record first |
|
|
// checkout the extent record first |
|
|
err = ChkExtRec( GPtr, extents, &lastExtentIndex ); |
|
|
err = ChkExtRec( GPtr, extents, &lastExtentIndex ); |
|
|
@@ -3105,7 +3105,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
|
|
|
|
|
|
|
|
|
@@ -3105,7 +3105,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
|
|
|
if ( err == btNotFound ) |
|
|
if ( err == btNotFound ) |
|
|
{ |
|
|
{ |
|
|
err = noErr; // no more extent records |
|
|
err = noErr; // no more extent records |
|
@ -1277,7 +1259,7 @@ index 39bda5c..c33155f 100644 |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
else if ( err != noErr ) |
|
|
else if ( err != noErr ) |
|
|
@@ -3121,7 +3121,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
|
|
|
|
|
|
|
|
|
@@ -3121,7 +3121,7 @@ OSErr CheckFileExtents( SGlobPtr GPtr, U
|
|
|
if ( err == btNotFound ) |
|
|
if ( err == btNotFound ) |
|
|
{ |
|
|
{ |
|
|
err = noErr; // no more extent records |
|
|
err = noErr; // no more extent records |
|
@ -1286,7 +1268,7 @@ index 39bda5c..c33155f 100644 |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
else if ( err != noErr ) |
|
|
else if ( err != noErr ) |
|
|
@@ -3205,7 +3205,7 @@ static OSErr AddExtentToOverlapList( SGlobPtr GPtr, HFSCatalogNodeID fileNumber,
|
|
|
|
|
|
|
|
|
@@ -3205,7 +3205,7 @@ static OSErr AddExtentToOverlapList( SGl
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// If it's uninitialized |
|
|
// If it's uninitialized |
|
@ -1295,11 +1277,9 @@ index 39bda5c..c33155f 100644 |
|
|
{ |
|
|
{ |
|
|
GPtr->overlappedExtents = (ExtentsTable **) NewHandleClear( sizeof(ExtentsTable) ); |
|
|
GPtr->overlappedExtents = (ExtentsTable **) NewHandleClear( sizeof(ExtentsTable) ); |
|
|
extentsTableH = GPtr->overlappedExtents; |
|
|
extentsTableH = GPtr->overlappedExtents; |
|
|
diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c
|
|
|
|
|
|
index c68f3d8..da1a982 100644
|
|
|
|
|
|
--- a/fsck_hfs.tproj/dfalib/SVerify2.c
|
|
|
--- a/fsck_hfs.tproj/dfalib/SVerify2.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SVerify2.c
|
|
|
+++ b/fsck_hfs.tproj/dfalib/SVerify2.c
|
|
|
@@ -1013,7 +1013,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
|
|
|
|
|
|
|
|
|
@@ -1013,7 +1013,7 @@ static int BTKeyChk( SGlobPtr GPtr, Node
|
|
|
UInt16 keyLength; |
|
|
UInt16 keyLength; |
|
|
KeyPtr keyPtr; |
|
|
KeyPtr keyPtr; |
|
|
UInt8 *dataPtr; |
|
|
UInt8 *dataPtr; |
|
@ -1308,7 +1288,7 @@ index c68f3d8..da1a982 100644 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( nodeP->numRecords == 0 ) |
|
|
if ( nodeP->numRecords == 0 ) |
|
|
@@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, NodeDescPtr nodeP, BTreeControlBlock *btcb )
|
|
|
|
|
|
|
|
|
@@ -1044,7 +1044,7 @@ static int BTKeyChk( SGlobPtr GPtr, Node
|
|
|
return( E_KeyLen ); |
|
|
return( E_KeyLen ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|