Author: tthompson
Date: Thu Jul 27 18:34:23 2017
New Revision: 75425
URL:
http://svn.reactos.org/svn/reactos?rev=75425&view=rev
Log:
[NTFS] - Add GetAllocationOffsetFromVCN() function, which was mistakenly left out of the
last commit.
Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c [iso-8859-1] Thu Jul 27
18:34:23 2017
@@ -511,6 +511,18 @@
DumpBTreeNode(Tree->RootNode, 0, 0);
}
+// Calculates start of Index Buffer relative to the index allocation, given the
node's VCN
+ULONGLONG
+GetAllocationOffsetFromVCN(PDEVICE_EXTENSION DeviceExt,
+ ULONG IndexBufferSize,
+ ULONGLONG Vcn)
+{
+ if (IndexBufferSize < DeviceExt->NtfsInfo.BytesPerCluster)
+ return Vcn * DeviceExt->NtfsInfo.BytesPerSector;
+
+ return Vcn * DeviceExt->NtfsInfo.BytesPerCluster;
+}
+
/**
* @name NtfsInsertKey
* @implemented