]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfscommon/BTree/BTreeNodeOps.c
xnu-1699.22.73.tar.gz
[apple/xnu.git] / bsd / hfs / hfscommon / BTree / BTreeNodeOps.c
index ab2962683a6fc7a932fba9a7724349616b7e3ca7..89f4eaf1323c02617f93cbdcae4f416dc207a83f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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@
  * 
@@ -191,32 +191,39 @@ Result:
 
 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;
@@ -270,7 +277,7 @@ OSStatus    GetNewNode      (BTreeControlBlockPtr    btreePtr,
                                           
        if (err != noErr)
        {
-               Panic ("\pGetNewNode: getNodeProc returned error.");
+               Panic ("GetNewNode: getNodeProc returned error.");
        //      returnNodePtr->buffer = nil;
                return err;
        }
@@ -320,7 +327,7 @@ OSStatus    ReleaseNode     (BTreeControlBlockPtr    btreePtr,
                err = releaseNodeProc (btreePtr->fileRefNum,
                                                           nodePtr,
                                                           kReleaseBlock );
-               PanicIf (err, "\pReleaseNode: releaseNodeProc returned error.");
+               PanicIf (err, "ReleaseNode: releaseNodeProc returned error.");
                ++btreePtr->numReleaseNodes;
        }
 
@@ -362,7 +369,7 @@ OSStatus    TrashNode       (BTreeControlBlockPtr    btreePtr,
                err = releaseNodeProc (btreePtr->fileRefNum,
                                                           nodePtr,
                                                           kReleaseBlock | kTrashBlock );
-               PanicIf (err, "\TrashNode: releaseNodeProc returned error.");
+               PanicIf (err, "TrashNode: releaseNodeProc returned error.");
                ++btreePtr->numReleaseNodes;
        }