ReactOS 0.4.16-dev-319-g6cf4263
|
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) | ||||||||||||||||||
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 417 of file btree.c.
Referenced by NtfsInsertKey().
ULONG CountBTreeKeys | ( | PB_TREE_KEY | FirstKey | ) |
Definition at line 484 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 682 of file btree.c.
Referenced by NtfsAddFilenameToDirectory().
PB_TREE_KEY CreateBTreeKeyFromFilename | ( | ULONGLONG | FileReference, |
PFILENAME_ATTRIBUTE | FileNameAttribute | ||
) |
Definition at line 1461 of file btree.c.
Referenced by NtfsInsertKey().
PB_TREE_FILENAME_NODE CreateBTreeNodeFromIndexNode | ( | PDEVICE_EXTENSION | Vcb, |
PINDEX_ROOT_ATTRIBUTE | IndexRoot, | ||
PNTFS_ATTR_CONTEXT | IndexAllocationAttributeCtx, | ||
PINDEX_ENTRY_ATTRIBUTE | NodeEntry | ||
) |
Definition at line 499 of file btree.c.
Referenced by CreateBTreeFromIndex(), and CreateBTreeNodeFromIndexNode().
PB_TREE_KEY CreateDummyKey | ( | BOOLEAN | HasChildNode | ) |
Definition at line 289 of file btree.c.
Referenced by CreateEmptyBTree(), DemoteBTreeRoot(), and SplitBTreeNode().
Definition at line 348 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 1001 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 910 of file btree.c.
Referenced by NtfsAddFilenameToDirectory(), and NtfsCreateDirectory().
Definition at line 1089 of file btree.c.
Referenced by NtfsAddFilenameToDirectory().
Definition at line 1542 of file btree.c.
Referenced by CreateBTreeFromIndex(), NtfsAddFilenameToDirectory(), and NtfsCreateDirectory().
VOID DestroyBTreeKey | ( | PB_TREE_KEY | Key | ) |
Definition at line 1499 of file btree.c.
Referenced by DestroyBTreeNode().
VOID DestroyBTreeNode | ( | PB_TREE_FILENAME_NODE | Node | ) |
Definition at line 1511 of file btree.c.
Referenced by CreateBTreeNodeFromIndexNode(), DestroyBTree(), and DestroyBTreeKey().
Definition at line 1622 of file btree.c.
Referenced by CreateIndexRootFromBTree(), DemoteBTreeRoot(), NtfsAddFilenameToDirectory(), NtfsInsertKey(), and UpdateIndexAllocation().
VOID DumpBTreeKey | ( | PB_TREE | Tree, |
PB_TREE_KEY | Key, | ||
ULONG | Number, | ||
ULONG | Depth | ||
) |
Definition at line 1549 of file btree.c.
Referenced by DumpBTreeNode().
VOID DumpBTreeNode | ( | PB_TREE | Tree, |
PB_TREE_FILENAME_NODE | Node, | ||
ULONG | Number, | ||
ULONG | Depth | ||
) |
Definition at line 1583 of file btree.c.
Referenced by DumpBTree(), DumpBTreeKey(), and SplitBTreeNode().
ULONGLONG GetAllocationOffsetFromVCN | ( | PDEVICE_EXTENSION | DeviceExt, |
ULONG | IndexBufferSize, | ||
ULONGLONG | Vcn | ||
) |
Definition at line 1630 of file btree.c.
Referenced by CreateBTreeNodeFromIndexNode(), and UpdateIndexNode().
ULONGLONG GetIndexEntryVCN | ( | PINDEX_ENTRY_ATTRIBUTE | IndexEntry | ) |
Definition at line 1641 of file btree.c.
Referenced by BrowseIndexEntries(), BrowseSubNodeIndexEntries(), and SplitBTreeNode().
ULONG GetSizeOfIndexEntries | ( | PB_TREE_FILENAME_NODE | Node | ) |
Definition at line 855 of file btree.c.
Referenced by NtfsAddFilenameToDirectory(), 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 1691 of file btree.c.
Referenced by NtfsAddFilenameToDirectory(), and NtfsInsertKey().
VOID PrintAllVCNs | ( | PDEVICE_EXTENSION | Vcb, |
PNTFS_ATTR_CONTEXT | IndexAllocationContext, | ||
ULONG | NodeSize | ||
) |
Definition at line 38 of file btree.c.
Referenced by UpdateIndexAllocation().
VOID SetIndexEntryVCN | ( | PINDEX_ENTRY_ATTRIBUTE | IndexEntry, |
ULONGLONG | VCN | ||
) |
Definition at line 1172 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 1883 of file btree.c.
Referenced by NtfsInsertKey().
NTSTATUS UpdateIndexAllocation | ( | PDEVICE_EXTENSION | DeviceExt, |
PB_TREE | Tree, | ||
ULONG | IndexBufferSize, | ||
PFILE_RECORD_HEADER | FileRecord | ||
) |
Definition at line 1182 of file btree.c.
Referenced by NtfsAddFilenameToDirectory().
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 1319 of file btree.c.
Referenced by UpdateIndexAllocation(), and UpdateIndexNode().