@@ -281,7 +281,7 @@ public void UpdateFileRecord(FileRecord fileRecord, uint transactionID)
281281 Dictionary < MftSegmentReference , byte [ ] > undoDictionary = new Dictionary < MftSegmentReference , byte [ ] > ( ) ;
282282 foreach ( FileRecordSegment segment in fileRecord . Segments )
283283 {
284- byte [ ] segmentBytes = GetFileRecordSegment ( segment . SegmentNumber ) . GetBytes ( m_volume . BytesPerFileRecordSegment , m_volume . MinorVersion , false ) ;
284+ byte [ ] segmentBytes = segment . GetBytes ( m_volume . BytesPerFileRecordSegment , m_volume . MinorVersion , false ) ;
285285 undoDictionary . Add ( segment . SegmentReference , segmentBytes ) ;
286286 }
287287
@@ -397,11 +397,10 @@ public FileRecord CreateFile(List<FileNameRecord> fileNameRecords, uint transact
397397 m_volume . LogClient . WriteLogRecord ( m_mftRecord . BaseSegmentReference , m_mftRecord . DataRecord , streamOffset , m_volume . BytesPerFileRecordSegment , NTFSLogOperation . InitializeFileRecordSegment , redoData , NTFSLogOperation . DeallocateFileRecordSegment , new byte [ 0 ] , transactionID ) ;
398398 UpdateFileRecordSegment ( fileRecordSegment ) ;
399399
400- fileRecordSegment . ReferenceCount = ( ushort ) fileNameRecords . Count ; // Each FileNameRecord is about to be indexed
401- fileRecordSegment . IsInUse = true ;
402- fileRecordSegment . IsDirectory = isDirectory ;
403-
404400 FileRecord fileRecord = new FileRecord ( fileRecordSegment ) ;
401+ fileRecord . ReferenceCount = ( ushort ) fileNameRecords . Count ; // Each FileNameRecord is about to be indexed
402+ fileRecord . IsInUse = true ;
403+ fileRecord . IsDirectory = isDirectory ;
405404 StandardInformationRecord standardInformation = ( StandardInformationRecord ) fileRecord . CreateAttributeRecord ( AttributeType . StandardInformation , String . Empty ) ;
406405 standardInformation . CreationTime = fileNameRecords [ 0 ] . CreationTime ;
407406 standardInformation . ModificationTime = fileNameRecords [ 0 ] . ModificationTime ;
@@ -435,7 +434,7 @@ public void DeleteFile(FileRecord fileRecord, uint transactionID)
435434 {
436435 foreach ( FileRecordSegment segment in fileRecord . Segments )
437436 {
438- byte [ ] undoData = GetFileRecordSegment ( segment . SegmentNumber ) . GetBytes ( m_volume . BytesPerFileRecordSegment , m_volume . MinorVersion , false ) ;
437+ byte [ ] undoData = segment . GetBytes ( m_volume . BytesPerFileRecordSegment , m_volume . MinorVersion , false ) ;
439438 ulong streamOffset = ( ulong ) ( segment . SegmentNumber * m_volume . BytesPerFileRecordSegment ) ;
440439 m_volume . LogClient . WriteLogRecord ( m_mftRecord . BaseSegmentReference , m_mftRecord . DataRecord , streamOffset , m_volume . BytesPerFileRecordSegment , NTFSLogOperation . DeallocateFileRecordSegment , new byte [ 0 ] , NTFSLogOperation . InitializeFileRecordSegment , undoData , transactionID ) ;
441440 DeallocateFileRecordSegment ( segment , transactionID ) ;
0 commit comments