[NTOSKRNL]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 5 Oct 2014 08:49:15 +0000 (08:49 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 5 Oct 2014 08:49:15 +0000 (08:49 +0000)
Kill MiZeroFillSection

svn path=/trunk/; revision=64533

reactos/ntoskrnl/cache/copysup.c
reactos/ntoskrnl/cache/section/data.c
reactos/ntoskrnl/cache/section/newmm.h

index 8820779..138af93 100644 (file)
@@ -186,7 +186,6 @@ CcCopyWrite(IN PFILE_OBJECT FileObject,
                WriteBuf,
                Bcb->BaseAddress);
 
-        //MiZeroFillSection(WriteBuf, &CurrentOffset, WriteLen);
         RtlCopyMemory(WriteBuf, ((PCHAR)Buffer) + Count, WriteLen);
         Count += WriteLen;
         Length -= WriteLen;
index 09ab943..3c70ff7 100644 (file)
@@ -112,78 +112,6 @@ _MmUnlockSectionSegment(PMM_SECTION_SEGMENT Segment, const char *file, int line)
     //DPRINT("MmUnlockSectionSegment(%p,%s:%d)\n", Segment, file, line);
 }
 
-NTSTATUS
-NTAPI
-MiZeroFillSection(PVOID Address, PLARGE_INTEGER FileOffsetPtr, ULONG Length)
-{
-    PFN_NUMBER Page;
-    PMMSUPPORT AddressSpace;
-    PMEMORY_AREA MemoryArea;
-    PMM_SECTION_SEGMENT Segment;
-    LARGE_INTEGER FileOffset = *FileOffsetPtr, End, FirstMapped;
-    KIRQL OldIrql;
-
-    DPRINT("MiZeroFillSection(Address %p, Offset 0x%I64x,Length 0x%lx)\n",
-           Address,
-           FileOffset.QuadPart,
-           Length);
-
-    AddressSpace = MmGetKernelAddressSpace();
-
-    MmLockAddressSpace(AddressSpace);
-    MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, Address);
-    MmUnlockAddressSpace(AddressSpace);
-    if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW || MemoryArea->DeleteInProgress)
-    {
-        return STATUS_NOT_MAPPED_DATA;
-    }
-
-    Segment = MemoryArea->Data.SectionData.Segment;
-    End.QuadPart = FileOffset.QuadPart + Length;
-    End.LowPart = PAGE_ROUND_DOWN(End.LowPart);
-    FileOffset.LowPart = PAGE_ROUND_UP(FileOffset.LowPart);
-    FirstMapped.QuadPart = MemoryArea->Data.SectionData.ViewOffset.QuadPart;
-    DPRINT("Pulling zero pages for %08x%08x-%08x%08x\n",
-           FileOffset.u.HighPart, FileOffset.u.LowPart,
-           End.u.HighPart, End.u.LowPart);
-
-    while (FileOffset.QuadPart < End.QuadPart)
-    {
-        PVOID CurrentAddress;
-        ULONG_PTR Entry;
-
-        if (!NT_SUCCESS(MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &Page)))
-            break;
-
-        MmLockAddressSpace(AddressSpace);
-        MmLockSectionSegment(Segment);
-
-        Entry = MmGetPageEntrySectionSegment(Segment, &FileOffset);
-        if (Entry == 0)
-        {
-            MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page));
-            CurrentAddress = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart;
-
-            OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
-            MmReferencePage(Page);
-            KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
-
-            MmCreateVirtualMapping(NULL, CurrentAddress, PAGE_READWRITE, &Page, 1);
-            MmInsertRmap(Page, NULL, CurrentAddress);
-        }
-        else
-        {
-            MmReleasePageMemoryConsumer(MC_CACHE, Page);
-        }
-
-        MmUnlockSectionSegment(Segment);
-        MmUnlockAddressSpace(AddressSpace);
-
-        FileOffset.QuadPart += PAGE_SIZE;
-    }
-    return STATUS_SUCCESS;
-}
-
 /*
 
 MiFlushMappedSection
index 43df777..d5f9998 100644 (file)
@@ -262,12 +262,6 @@ MiCowCacheSectionPage (
     _In_ BOOLEAN Locked,
     _Inout_ PMM_REQUIRED_RESOURCES Required);
 
-NTSTATUS
-NTAPI
-MiZeroFillSection(PVOID Address,
-                  PLARGE_INTEGER FileOffsetPtr,
-                  ULONG Length);
-
 VOID
 MmPageOutDeleteMapping(PVOID Context,
                        PEPROCESS Process,