/*
- * Copyright (c) 2000, 2002, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2002, 2005-2008 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
OSStatus GetNode (BTreeControlBlockPtr btreePtr,
u_int32_t nodeNum,
+ u_int32_t flags,
NodeRec *nodePtr )
{
OSStatus err;
GetBlockProcPtr getNodeProc;
+ u_int32_t options;
- //\80\80 is nodeNum within proper range?
+ // is nodeNum within proper range?
if( nodeNum >= btreePtr->totalNodes )
{
- Panic("\pGetNode:nodeNum >= totalNodes");
+ Panic("GetNode:nodeNum >= totalNodes");
err = fsBTInvalidNodeErr;
goto ErrorExit;
}
nodePtr->blockSize = btreePtr->nodeSize; // indicate the size of a node
+
+ options = kGetBlock;
+ if ( flags & kGetNodeHint )
+ {
+ options |= kGetBlockHint;
+ }
getNodeProc = btreePtr->getBlockProc;
err = getNodeProc (btreePtr->fileRefNum,
nodeNum,
- kGetBlock,
+ options,
nodePtr );
if (err != noErr)
{
- Panic ("\pGetNode: getNodeProc returned error.");
- // nodePtr->buffer = nil;
+ Panic ("GetNode: getNodeProc returned error.");
goto ErrorExit;
}
++btreePtr->numGetNodes;
if (err != noErr)
{
- Panic ("\pGetNewNode: getNodeProc returned error.");
+ Panic ("GetNewNode: getNodeProc returned error.");
// returnNodePtr->buffer = nil;
return err;
}
err = releaseNodeProc (btreePtr->fileRefNum,
nodePtr,
kReleaseBlock );
- PanicIf (err, "\pReleaseNode: releaseNodeProc returned error.");
+ PanicIf (err, "ReleaseNode: releaseNodeProc returned error.");
++btreePtr->numReleaseNodes;
}
err = releaseNodeProc (btreePtr->fileRefNum,
nodePtr,
kReleaseBlock | kTrashBlock );
- PanicIf (err, "\TrashNode: releaseNodeProc returned error.");
+ PanicIf (err, "TrashNode: releaseNodeProc returned error.");
++btreePtr->numReleaseNodes;
}