]> 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@
  * 
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -191,32 +191,39 @@ Result:
 
 OSStatus       GetNode         (BTreeControlBlockPtr    btreePtr,
                                                 u_int32_t                               nodeNum,
 
 OSStatus       GetNode         (BTreeControlBlockPtr    btreePtr,
                                                 u_int32_t                               nodeNum,
+                                                u_int32_t                               flags, 
                                                 NodeRec                                *nodePtr )
 {
        OSStatus                        err;
        GetBlockProcPtr         getNodeProc;
                                                 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 )
        {
        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
                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,
        
        getNodeProc = btreePtr->getBlockProc;
        err = getNodeProc (btreePtr->fileRefNum,
                                           nodeNum,
-                                          kGetBlock,
+                                          options,
                                           nodePtr );
 
        if (err != noErr)
        {
                                           nodePtr );
 
        if (err != noErr)
        {
-               Panic ("\pGetNode: getNodeProc returned error.");
-       //      nodePtr->buffer = nil;
+               Panic ("GetNode: getNodeProc returned error.");
                goto ErrorExit;
        }
        ++btreePtr->numGetNodes;
                goto ErrorExit;
        }
        ++btreePtr->numGetNodes;
@@ -270,7 +277,7 @@ OSStatus    GetNewNode      (BTreeControlBlockPtr    btreePtr,
                                           
        if (err != noErr)
        {
                                           
        if (err != noErr)
        {
-               Panic ("\pGetNewNode: getNodeProc returned error.");
+               Panic ("GetNewNode: getNodeProc returned error.");
        //      returnNodePtr->buffer = nil;
                return err;
        }
        //      returnNodePtr->buffer = nil;
                return err;
        }
@@ -320,7 +327,7 @@ OSStatus    ReleaseNode     (BTreeControlBlockPtr    btreePtr,
                err = releaseNodeProc (btreePtr->fileRefNum,
                                                           nodePtr,
                                                           kReleaseBlock );
                err = releaseNodeProc (btreePtr->fileRefNum,
                                                           nodePtr,
                                                           kReleaseBlock );
-               PanicIf (err, "\pReleaseNode: releaseNodeProc returned error.");
+               PanicIf (err, "ReleaseNode: releaseNodeProc returned error.");
                ++btreePtr->numReleaseNodes;
        }
 
                ++btreePtr->numReleaseNodes;
        }
 
@@ -362,7 +369,7 @@ OSStatus    TrashNode       (BTreeControlBlockPtr    btreePtr,
                err = releaseNodeProc (btreePtr->fileRefNum,
                                                           nodePtr,
                                                           kReleaseBlock | kTrashBlock );
                err = releaseNodeProc (btreePtr->fileRefNum,
                                                           nodePtr,
                                                           kReleaseBlock | kTrashBlock );
-               PanicIf (err, "\TrashNode: releaseNodeProc returned error.");
+               PanicIf (err, "TrashNode: releaseNodeProc returned error.");
                ++btreePtr->numReleaseNodes;
        }
 
                ++btreePtr->numReleaseNodes;
        }