Author: tthompson
Date: Thu Jun 23 15:37:19 2016
New Revision: 71662
URL:
http://svn.reactos.org/svn/reactos?rev=71662&view=rev
Log:
[NTFS]
Fix Up AddFixupArray - It needs to accept a PNTFS_RECORD_HEADER for parameter 2, not a
PFILE_RECORD_HEADER.
Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] Thu Jun 23
15:37:19 2016
@@ -701,7 +701,7 @@
DPRINT("UpdateFileRecord(%p, %I64x, %p)\n", Vcb, index, file);
// Add the fixup array to prepare the data for writing to disk
- AddFixupArray(Vcb, file);
+ AddFixupArray(Vcb, &file->Ntfs);
// write the file record to the master file table
Status = WriteAttribute(Vcb, Vcb->MFTContext, index *
Vcb->NtfsInfo.BytesPerFileRecord, (const PUCHAR)file,
Vcb->NtfsInfo.BytesPerFileRecord, &BytesWritten);
@@ -750,27 +750,24 @@
NTSTATUS
AddFixupArray(PDEVICE_EXTENSION Vcb,
- PFILE_RECORD_HEADER Record)
+ PNTFS_RECORD_HEADER Record)
{
USHORT *pShortToFixUp;
- unsigned int ArrayEntryCount = Record->BytesAllocated /
Vcb->NtfsInfo.BytesPerSector;
+ unsigned int ArrayEntryCount = Record->UsaCount - 1;
unsigned int Offset = Vcb->NtfsInfo.BytesPerSector - 2;
int i;
- PFIXUP_ARRAY fixupArray = (PFIXUP_ARRAY)((UCHAR*)Record +
Record->Ntfs.UsaOffset);
+ PFIXUP_ARRAY fixupArray = (PFIXUP_ARRAY)((UCHAR*)Record + Record->UsaOffset);
DPRINT("AddFixupArray(%p, %p)\n fixupArray->USN: %u, ArrayEntryCount:
%u\n", Vcb, Record, fixupArray->USN, ArrayEntryCount);
- if (Record->BytesAllocated % Vcb->NtfsInfo.BytesPerSector != 0)
- ArrayEntryCount++;
-
fixupArray->USN++;
for (i = 0; i < ArrayEntryCount; i++)
{
DPRINT("USN: %u\tOffset: %u\n", fixupArray->USN, Offset);
- pShortToFixUp = (USHORT*)((UCHAR*)Record + Offset);
+ pShortToFixUp = (USHORT*)((PCHAR)Record + Offset);
fixupArray->Array[i] = *pShortToFixUp;
*pShortToFixUp = fixupArray->USN;
Offset += Vcb->NtfsInfo.BytesPerSector;
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Thu Jun 23
15:37:19 2016
@@ -811,7 +811,7 @@
NTSTATUS
AddFixupArray(PDEVICE_EXTENSION Vcb,
- PFILE_RECORD_HEADER Record);
+ PNTFS_RECORD_HEADER Record);
NTSTATUS
ReadLCN(PDEVICE_EXTENSION Vcb,