X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8f6c56a50524aa785f7e596d52dddfb331e18961..0b4c1975fb5e4eccf1012a35081f7e7799b81046:/bsd/hfs/hfscommon/headers/BTreesInternal.h diff --git a/bsd/hfs/hfscommon/headers/BTreesInternal.h b/bsd/hfs/hfscommon/headers/BTreesInternal.h index ef0906cd4..c683d0b74 100644 --- a/bsd/hfs/hfscommon/headers/BTreesInternal.h +++ b/bsd/hfs/hfscommon/headers/BTreesInternal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -144,6 +144,7 @@ typedef FSBufferDescriptor *FSBufferDescriptorPtr; */ enum { kGetBlock = 0x00000000, + kGetBlockHint = 0x00000001, // if set, the block is being looked up using hint kForceReadBlock = 0x00000002, //€€ how does this relate to Read/Verify? Do we need this? kGetEmptyBlock = 0x00000008 }; @@ -161,15 +162,15 @@ enum { }; typedef OptionBits ReleaseBlockOptions; -typedef UInt64 FSSize; -typedef UInt32 ForkBlockNumber; +typedef u_int64_t FSSize; +typedef u_int32_t ForkBlockNumber; /*============================================================================ Fork Level Buffered I/O Access Method ============================================================================*/ typedef OSStatus (* GetBlockProcPtr) (FileReference fileRefNum, - UInt32 blockNum, + u_int32_t blockNum, GetBlockOptions options, BlockDescriptor *block ); @@ -208,7 +209,7 @@ enum BTreeIterationOperations{ kBTreeLastRecord, kBTreeCurrentRecord }; -typedef UInt16 BTreeIterationOperation; +typedef u_int16_t BTreeIterationOperation; /* @@ -234,30 +235,30 @@ typedef BTreeKey *BTreeKeyPtr; BTreeInfoRec Structure - for BTGetInformation */ struct BTreeInfoRec{ - UInt16 version; - UInt16 nodeSize; - UInt16 maxKeyLength; - UInt16 treeDepth; - UInt32 lastfsync; /* Last time that this was fsynced */ + u_int16_t version; + u_int16_t nodeSize; + u_int16_t maxKeyLength; + u_int16_t treeDepth; + u_int32_t lastfsync; /* Last time that this was fsynced */ ItemCount numRecords; ItemCount numNodes; ItemCount numFreeNodes; - UInt8 keyCompareType; - UInt8 reserved[3]; + u_int8_t keyCompareType; + u_int8_t reserved[3]; }; typedef struct BTreeInfoRec BTreeInfoRec; typedef BTreeInfoRec *BTreeInfoPtr; /* - BTreeHint can never be exported to the outside. Use UInt32 BTreeHint[4], - UInt8 BTreeHint[16], etc. + BTreeHint can never be exported to the outside. Use u_int32_t BTreeHint[4], + u_int8_t BTreeHint[16], etc. */ struct BTreeHint{ ItemCount writeCount; - UInt32 nodeNum; // node the key was last seen in - UInt16 index; // index then key was last seen at - UInt16 reserved1; - UInt32 reserved2; + u_int32_t nodeNum; // node the key was last seen in + u_int16_t index; // index then key was last seen at + u_int16_t reserved1; + u_int32_t reserved2; }; typedef struct BTreeHint BTreeHint; typedef BTreeHint *BTreeHintPtr; @@ -267,10 +268,10 @@ typedef BTreeHint *BTreeHintPtr; */ struct BTreeIterator{ BTreeHint hint; - UInt16 version; - UInt16 reserved; - UInt32 hitCount; // Total number of leaf records hit - UInt32 maxLeafRecs; // Max leaf records over iteration + u_int16_t version; + u_int16_t reserved; + u_int32_t hitCount; // Total number of leaf records hit + u_int32_t maxLeafRecs; // Max leaf records over iteration BTreeKey key; }; typedef struct BTreeIterator BTreeIterator; @@ -284,10 +285,10 @@ typedef BTreeIterator *BTreeIteratorPtr; /* Key Comparison Function ProcPtr Type - for BTOpenPath */ -//typedef SInt32 (* KeyCompareProcPtr)(BTreeKeyPtr a, BTreeKeyPtr b); +//typedef int32_t (* KeyCompareProcPtr)(BTreeKeyPtr a, BTreeKeyPtr b); -typedef SInt32 (* IterateCallBackProcPtr)(BTreeKeyPtr key, void * record, void * state); +typedef int32_t (* IterateCallBackProcPtr)(BTreeKeyPtr key, void * record, void * state); extern OSStatus BTOpenPath(FCB *filePtr, KeyCompareProcPtr keyCompareProc); @@ -298,14 +299,14 @@ extern OSStatus BTClosePath (FCB *filePtr ); extern OSStatus BTSearchRecord (FCB *filePtr, BTreeIterator *searchIterator, FSBufferDescriptor *btRecord, - UInt16 *recordLen, + u_int16_t *recordLen, BTreeIterator *resultIterator ); extern OSStatus BTIterateRecord (FCB *filePtr, BTreeIterationOperation operation, BTreeIterator *iterator, FSBufferDescriptor *btRecord, - UInt16 *recordLen ); + u_int16_t *recordLen ); extern OSStatus BTIterateRecords(FCB *filePtr, BTreeIterationOperation operation, BTreeIterator *iterator, @@ -314,12 +315,12 @@ extern OSStatus BTIterateRecords(FCB *filePtr, BTreeIterationOperation operation extern OSStatus BTInsertRecord (FCB *filePtr, BTreeIterator *iterator, FSBufferDescriptor *btrecord, - UInt16 recordLen ); + u_int16_t recordLen ); extern OSStatus BTReplaceRecord (FCB *filePtr, BTreeIterator *iterator, FSBufferDescriptor *btRecord, - UInt16 recordLen ); + u_int16_t recordLen ); extern OSStatus BTUpdateRecord (FCB *filePtr, BTreeIterator *iterator, @@ -330,9 +331,11 @@ extern OSStatus BTDeleteRecord (FCB *filePtr, BTreeIterator *iterator ); extern OSStatus BTGetInformation (FCB *filePtr, - UInt16 vers, + u_int16_t vers, BTreeInfoRec *info ); +extern OSStatus BTIsDirty(FCB *filePtr); + extern OSStatus BTFlushPath (FCB *filePtr ); extern OSStatus BTReloadData (FCB *filePtr); @@ -340,10 +343,10 @@ extern OSStatus BTReloadData (FCB *filePtr); extern OSStatus BTInvalidateHint (BTreeIterator *iterator ); extern OSStatus BTGetLastSync (FCB *filePtr, - UInt32 *lastfsync ); + u_int32_t *lastfsync ); extern OSStatus BTSetLastSync (FCB *filePtr, - UInt32 lastfsync ); + u_int32_t lastfsync ); extern OSStatus BTHasContiguousNodes(FCB *filePtr); @@ -358,6 +361,7 @@ extern int BTReserveSpace(FCB *file, int operations, void * data); extern int BTReleaseReserve(FCB *file, void * data); +extern int BTZeroUnusedNodes(FCB *file); #endif /* __APPLE_API_PRIVATE */ #endif /* KERNEL */