|
ReactOS 0.4.17-dev-1190-g4c812f4
|

Go to the source code of this file.
Macros | |
| #define | NDEBUG |
Functions | |||||||||||||||||||
| VOID | PrintAllVCNs (PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT IndexAllocationContext, ULONG NodeSize) | ||||||||||||||||||
AllocateIndexNode | |||||||||||||||||||
@implemented Allocates a new index record in an index allocation.
| |||||||||||||||||||
| NTSTATUS | AllocateIndexNode (PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, ULONG IndexBufferSize, PNTFS_ATTR_CONTEXT IndexAllocationCtx, ULONG IndexAllocationOffset, PULONGLONG NewVCN) | ||||||||||||||||||
CreateDummyKey | |||||||||||||||||||
@implemented Creates the final B_TREE_KEY for a B_TREE_FILENAME_NODE. Also creates the associated index entry.
| |||||||||||||||||||
| PB_TREE_KEY | CreateDummyKey (BOOLEAN HasChildNode) | ||||||||||||||||||
CreateEmptyBTree | |||||||||||||||||||
@implemented Creates an empty B-Tree, which will contain a single root node which will contain a single dummy key.
| |||||||||||||||||||
| NTSTATUS | CreateEmptyBTree (PB_TREE *NewTree) | ||||||||||||||||||
CompareTreeKeys | |||||||||||||||||||
@implemented Compare two B_TREE_KEY's to determine their order in the tree.
| |||||||||||||||||||
| LONG | CompareTreeKeys (PB_TREE_KEY Key1, PB_TREE_KEY Key2, BOOLEAN CaseSensitive) | ||||||||||||||||||
CountBTreeKeys | |||||||||||||||||||
@implemented Counts the number of linked B-Tree keys, starting with FirstKey.
| |||||||||||||||||||
| ULONG | CountBTreeKeys (PB_TREE_KEY FirstKey) | ||||||||||||||||||
| PB_TREE_FILENAME_NODE | CreateBTreeNodeFromIndexNode (PDEVICE_EXTENSION Vcb, PINDEX_ROOT_ATTRIBUTE IndexRoot, PNTFS_ATTR_CONTEXT IndexAllocationAttributeCtx, PINDEX_ENTRY_ATTRIBUTE NodeEntry) | ||||||||||||||||||
CreateBTreeFromIndex | |||||||||||||||||||
@implemented Parse an index and create a B-Tree in memory from it.
| |||||||||||||||||||
| NTSTATUS | CreateBTreeFromIndex (PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecordWithIndex, PNTFS_ATTR_CONTEXT IndexRootContext, PINDEX_ROOT_ATTRIBUTE IndexRoot, PB_TREE *NewTree) | ||||||||||||||||||
GetSizeOfIndexEntries | |||||||||||||||||||
@implemented Sums the size of each index entry in every key in a B-Tree node.
| |||||||||||||||||||
| ULONG | GetSizeOfIndexEntries (PB_TREE_FILENAME_NODE Node) | ||||||||||||||||||
CreateIndexRootFromBTree | |||||||||||||||||||
@implemented Parse a B-Tree in memory and convert it into an index that can be written to disk.
After reaching MaxIndexSize, an index can no longer be represented with just an index root attribute, and will require an index allocation and $I30 bitmap (TODO).
| |||||||||||||||||||
| NTSTATUS | CreateIndexRootFromBTree (PDEVICE_EXTENSION DeviceExt, PB_TREE Tree, ULONG MaxIndexSize, PINDEX_ROOT_ATTRIBUTE *IndexRoot, ULONG *Length) | ||||||||||||||||||
| NTSTATUS | CreateIndexBufferFromBTreeNode (PDEVICE_EXTENSION DeviceExt, PB_TREE_FILENAME_NODE Node, ULONG BufferSize, BOOLEAN HasChildren, PINDEX_BUFFER IndexBuffer) | ||||||||||||||||||
DemoteBTreeRoot | |||||||||||||||||||
@implemented Demoting the root means first putting all the keys in the root node into a new node, and making the new node a child of a dummy key. The dummy key then becomes the sole contents of the root node. The B-Tree gets one level deeper. This operation is needed when an index root grows too large for its file record. Demotion is my own term; I might change the name later if I think of something more descriptive or can find an appropriate name for this operation in existing B-Tree literature.
| |||||||||||||||||||
| NTSTATUS | DemoteBTreeRoot (PB_TREE Tree) | ||||||||||||||||||
SetIndexEntryVCN | |||||||||||||||||||
@implemented Sets the VCN of a given IndexEntry.
| |||||||||||||||||||
| VOID | SetIndexEntryVCN (PINDEX_ENTRY_ATTRIBUTE IndexEntry, ULONGLONG VCN) | ||||||||||||||||||
| NTSTATUS | UpdateIndexAllocation (PDEVICE_EXTENSION DeviceExt, PB_TREE Tree, ULONG IndexBufferSize, PFILE_RECORD_HEADER FileRecord) | ||||||||||||||||||
| NTSTATUS | UpdateIndexNode (PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, PB_TREE_FILENAME_NODE Node, ULONG IndexBufferSize, PNTFS_ATTR_CONTEXT IndexAllocationContext, ULONG IndexAllocationOffset) | ||||||||||||||||||
| PB_TREE_KEY | CreateBTreeKeyFromFilename (ULONGLONG FileReference, PFILENAME_ATTRIBUTE FileNameAttribute) | ||||||||||||||||||
| VOID | DestroyBTreeKey (PB_TREE_KEY Key) | ||||||||||||||||||
| VOID | DestroyBTreeNode (PB_TREE_FILENAME_NODE Node) | ||||||||||||||||||
DestroyBTree | |||||||||||||||||||
@implemented Destroys a B-Tree.
| |||||||||||||||||||
| VOID | DestroyBTree (PB_TREE Tree) | ||||||||||||||||||
| VOID | DumpBTreeKey (PB_TREE Tree, PB_TREE_KEY Key, ULONG Number, ULONG Depth) | ||||||||||||||||||
| VOID | DumpBTreeNode (PB_TREE Tree, PB_TREE_FILENAME_NODE Node, ULONG Number, ULONG Depth) | ||||||||||||||||||
DumpBTree | |||||||||||||||||||
| VOID | DumpBTree (PB_TREE Tree) | ||||||||||||||||||
| ULONGLONG | GetAllocationOffsetFromVCN (PDEVICE_EXTENSION DeviceExt, ULONG IndexBufferSize, ULONGLONG Vcn) | ||||||||||||||||||
| ULONGLONG | GetIndexEntryVCN (PINDEX_ENTRY_ATTRIBUTE IndexEntry) | ||||||||||||||||||
NtfsInsertKey | |||||||||||||||||||
@implemented Inserts a FILENAME_ATTRIBUTE into a B-Tree node.
| |||||||||||||||||||
| NTSTATUS | NtfsInsertKey (PB_TREE Tree, ULONGLONG FileReference, PFILENAME_ATTRIBUTE FileNameAttribute, PB_TREE_FILENAME_NODE Node, BOOLEAN CaseSensitive, ULONG MaxIndexRootSize, ULONG IndexRecordSize, PB_TREE_KEY *MedianKey, PB_TREE_FILENAME_NODE *NewRightHandSibling) | ||||||||||||||||||
FindLargestKeyInSubtree | |||||||||||||||||||
@implemented Finds the greatest key in the subtree rooted at Node, along with the node holding it and the key that precedes it in that node's list.
| |||||||||||||||||||
| static VOID | FindLargestKeyInSubtree (PB_TREE_FILENAME_NODE Node, PB_TREE_FILENAME_NODE *OwnerNode, PB_TREE_KEY *PreviousKey, PB_TREE_KEY *LargestKey) | ||||||||||||||||||
ReplaceKeyIndexEntry | |||||||||||||||||||
@implemented Replaces the index entry of Key with a copy of Source's, leaving Key's child pointer alone.
| |||||||||||||||||||
| static NTSTATUS | ReplaceKeyIndexEntry (PB_TREE_KEY Key, PB_TREE_KEY Source) | ||||||||||||||||||
RemoveKeyFromNode | |||||||||||||||||||
@implemented Removes a key that has already been located from the node that holds it.
| |||||||||||||||||||
| static NTSTATUS | RemoveKeyFromNode (PB_TREE_FILENAME_NODE Node, PB_TREE_KEY PreviousKey, PB_TREE_KEY Key) | ||||||||||||||||||
NtfsRemoveKey | |||||||||||||||||||
@implemented Removes the key matching a given filename from a B-Tree.
| |||||||||||||||||||
| NTSTATUS | NtfsRemoveKey (PB_TREE_FILENAME_NODE Node, PB_TREE_KEY SearchKey, BOOLEAN CaseSensitive) | ||||||||||||||||||
SplitBTreeNode | |||||||||||||||||||
@implemented Splits a B-Tree node that has grown too large. Finds the median key and sets up a right-hand-sibling node to contain the keys to the right of the median key.
| |||||||||||||||||||
| NTSTATUS | SplitBTreeNode (PB_TREE Tree, PB_TREE_FILENAME_NODE Node, PB_TREE_KEY *MedianKey, PB_TREE_FILENAME_NODE *NewRightHandSibling, BOOLEAN CaseSensitive) | ||||||||||||||||||
| NTSTATUS AllocateIndexNode | ( | PDEVICE_EXTENSION | DeviceExt, |
| PFILE_RECORD_HEADER | FileRecord, | ||
| ULONG | IndexBufferSize, | ||
| PNTFS_ATTR_CONTEXT | IndexAllocationCtx, | ||
| ULONG | IndexAllocationOffset, | ||
| PULONGLONG | NewVCN | ||
| ) |
Definition at line 117 of file btree.c.
Referenced by UpdateIndexNode().
| LONG CompareTreeKeys | ( | PB_TREE_KEY | Key1, |
| PB_TREE_KEY | Key2, | ||
| BOOLEAN | CaseSensitive | ||
| ) |
Definition at line 422 of file btree.c.
Referenced by NtfsInsertKey(), and NtfsRemoveKey().
| ULONG CountBTreeKeys | ( | PB_TREE_KEY | FirstKey | ) |
Definition at line 489 of file btree.c.
Referenced by SplitBTreeNode().
| NTSTATUS CreateBTreeFromIndex | ( | PDEVICE_EXTENSION | Vcb, |
| PFILE_RECORD_HEADER | FileRecordWithIndex, | ||
| PNTFS_ATTR_CONTEXT | IndexRootContext, | ||
| PINDEX_ROOT_ATTRIBUTE | IndexRoot, | ||
| PB_TREE * | NewTree | ||
| ) |
Definition at line 687 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), and RemoveFilenameFromDirectoryWorker().
| PB_TREE_KEY CreateBTreeKeyFromFilename | ( | ULONGLONG | FileReference, |
| PFILENAME_ATTRIBUTE | FileNameAttribute | ||
| ) |
Definition at line 1466 of file btree.c.
Referenced by NtfsInsertKey(), and RemoveFilenameFromDirectoryWorker().
| PB_TREE_FILENAME_NODE CreateBTreeNodeFromIndexNode | ( | PDEVICE_EXTENSION | Vcb, |
| PINDEX_ROOT_ATTRIBUTE | IndexRoot, | ||
| PNTFS_ATTR_CONTEXT | IndexAllocationAttributeCtx, | ||
| PINDEX_ENTRY_ATTRIBUTE | NodeEntry | ||
| ) |
Definition at line 504 of file btree.c.
Referenced by CreateBTreeFromIndex(), and CreateBTreeNodeFromIndexNode().
| PB_TREE_KEY CreateDummyKey | ( | BOOLEAN | HasChildNode | ) |
Definition at line 294 of file btree.c.
Referenced by CreateEmptyBTree(), DemoteBTreeRoot(), and SplitBTreeNode().
Definition at line 353 of file btree.c.
Referenced by NtfsCreateDirectory().
| NTSTATUS CreateIndexBufferFromBTreeNode | ( | PDEVICE_EXTENSION | DeviceExt, |
| PB_TREE_FILENAME_NODE | Node, | ||
| ULONG | BufferSize, | ||
| BOOLEAN | HasChildren, | ||
| PINDEX_BUFFER | IndexBuffer | ||
| ) |
Definition at line 1006 of file btree.c.
Referenced by UpdateIndexNode().
| NTSTATUS CreateIndexRootFromBTree | ( | PDEVICE_EXTENSION | DeviceExt, |
| PB_TREE | Tree, | ||
| ULONG | MaxIndexSize, | ||
| PINDEX_ROOT_ATTRIBUTE * | IndexRoot, | ||
| ULONG * | Length | ||
| ) |
Definition at line 915 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), NtfsCreateDirectory(), and RemoveFilenameFromDirectoryWorker().
Definition at line 1094 of file btree.c.
Referenced by AddFilenameToDirectoryWorker().
Definition at line 1549 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), CreateBTreeFromIndex(), NtfsCreateDirectory(), and RemoveFilenameFromDirectoryWorker().
| VOID DestroyBTreeKey | ( | PB_TREE_KEY | Key | ) |
Definition at line 1506 of file btree.c.
Referenced by DestroyBTreeNode(), NtfsInsertKey(), RemoveFilenameFromDirectoryWorker(), and RemoveKeyFromNode().
| VOID DestroyBTreeNode | ( | PB_TREE_FILENAME_NODE | Node | ) |
Definition at line 1518 of file btree.c.
Referenced by CreateBTreeNodeFromIndexNode(), DestroyBTree(), and DestroyBTreeKey().
Definition at line 1629 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), CreateIndexRootFromBTree(), DemoteBTreeRoot(), NtfsInsertKey(), and UpdateIndexAllocation().
| VOID DumpBTreeKey | ( | PB_TREE | Tree, |
| PB_TREE_KEY | Key, | ||
| ULONG | Number, | ||
| ULONG | Depth | ||
| ) |
Definition at line 1556 of file btree.c.
Referenced by DumpBTreeNode().
| VOID DumpBTreeNode | ( | PB_TREE | Tree, |
| PB_TREE_FILENAME_NODE | Node, | ||
| ULONG | Number, | ||
| ULONG | Depth | ||
| ) |
Definition at line 1590 of file btree.c.
Referenced by DumpBTree(), DumpBTreeKey(), and SplitBTreeNode().
|
static |
Definition at line 1887 of file btree.c.
Referenced by FindLargestKeyInSubtree(), and RemoveKeyFromNode().
| ULONGLONG GetAllocationOffsetFromVCN | ( | PDEVICE_EXTENSION | DeviceExt, |
| ULONG | IndexBufferSize, | ||
| ULONGLONG | Vcn | ||
| ) |
Definition at line 1637 of file btree.c.
Referenced by BrowseSubNodeIndexEntries(), CreateBTreeNodeFromIndexNode(), NtfsIndexNodeIsEmpty(), and UpdateIndexNode().
| ULONGLONG GetIndexEntryVCN | ( | PINDEX_ENTRY_ATTRIBUTE | IndexEntry | ) |
Definition at line 1648 of file btree.c.
Referenced by BrowseIndexEntries(), BrowseSubNodeIndexEntries(), NtfsIndexEntriesAreEmpty(), and SplitBTreeNode().
| ULONG GetSizeOfIndexEntries | ( | PB_TREE_FILENAME_NODE | Node | ) |
Definition at line 860 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), and NtfsInsertKey().
| NTSTATUS NtfsInsertKey | ( | PB_TREE | Tree, |
| ULONGLONG | FileReference, | ||
| PFILENAME_ATTRIBUTE | FileNameAttribute, | ||
| PB_TREE_FILENAME_NODE | Node, | ||
| BOOLEAN | CaseSensitive, | ||
| ULONG | MaxIndexRootSize, | ||
| ULONG | IndexRecordSize, | ||
| PB_TREE_KEY * | MedianKey, | ||
| PB_TREE_FILENAME_NODE * | NewRightHandSibling | ||
| ) |
Definition at line 1698 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), and NtfsInsertKey().
| NTSTATUS NtfsRemoveKey | ( | PB_TREE_FILENAME_NODE | Node, |
| PB_TREE_KEY | SearchKey, | ||
| BOOLEAN | CaseSensitive | ||
| ) |
Definition at line 2067 of file btree.c.
Referenced by NtfsRemoveKey(), and RemoveFilenameFromDirectoryWorker().
| VOID PrintAllVCNs | ( | PDEVICE_EXTENSION | Vcb, |
| PNTFS_ATTR_CONTEXT | IndexAllocationContext, | ||
| ULONG | NodeSize | ||
| ) |
Definition at line 38 of file btree.c.
Referenced by UpdateIndexAllocation().
|
static |
Definition at line 1995 of file btree.c.
Referenced by NtfsRemoveKey(), and RemoveKeyFromNode().
|
static |
Definition at line 1947 of file btree.c.
Referenced by RemoveKeyFromNode().
| VOID SetIndexEntryVCN | ( | PINDEX_ENTRY_ATTRIBUTE | IndexEntry, |
| ULONGLONG | VCN | ||
| ) |
Definition at line 1177 of file btree.c.
Referenced by SplitBTreeNode(), UpdateIndexAllocation(), and UpdateIndexNode().
| NTSTATUS SplitBTreeNode | ( | PB_TREE | Tree, |
| PB_TREE_FILENAME_NODE | Node, | ||
| PB_TREE_KEY * | MedianKey, | ||
| PB_TREE_FILENAME_NODE * | NewRightHandSibling, | ||
| BOOLEAN | CaseSensitive | ||
| ) |
Definition at line 2138 of file btree.c.
Referenced by NtfsInsertKey().
| NTSTATUS UpdateIndexAllocation | ( | PDEVICE_EXTENSION | DeviceExt, |
| PB_TREE | Tree, | ||
| ULONG | IndexBufferSize, | ||
| PFILE_RECORD_HEADER | FileRecord | ||
| ) |
Definition at line 1187 of file btree.c.
Referenced by AddFilenameToDirectoryWorker(), and RemoveFilenameFromDirectoryWorker().
| NTSTATUS UpdateIndexNode | ( | PDEVICE_EXTENSION | DeviceExt, |
| PFILE_RECORD_HEADER | FileRecord, | ||
| PB_TREE_FILENAME_NODE | Node, | ||
| ULONG | IndexBufferSize, | ||
| PNTFS_ATTR_CONTEXT | IndexAllocationContext, | ||
| ULONG | IndexAllocationOffset | ||
| ) |
Definition at line 1324 of file btree.c.
Referenced by UpdateIndexAllocation(), and UpdateIndexNode().