mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
[NTOSKRNL] Drop the alloc map from page file
It was making no sense, and implemented in a broken way that couldn't have worked if code path was used.
This commit is contained in:
parent
5bd938bd24
commit
891a6eeeb9
1 changed files with 1 additions and 17 deletions
|
@ -271,19 +271,6 @@ MmInitPagingFile(VOID)
|
|||
MmNumberOfPagingFiles = 0;
|
||||
}
|
||||
|
||||
static ULONG
|
||||
MiAllocPageFromPagingFile(PMMPAGING_FILE PagingFile)
|
||||
{
|
||||
KIRQL oldIrql;
|
||||
ULONG off;
|
||||
|
||||
KeAcquireSpinLock(&PagingFile->AllocMapLock, &oldIrql);
|
||||
off = RtlFindClearBitsAndSet(PagingFile->AllocMap, 1, 0);
|
||||
KeReleaseSpinLock(&PagingFile->AllocMapLock, oldIrql);
|
||||
|
||||
return off;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MmFreeSwapPage(SWAPENTRY Entry)
|
||||
|
@ -303,7 +290,6 @@ MmFreeSwapPage(SWAPENTRY Entry)
|
|||
{
|
||||
KeBugCheck(MEMORY_MANAGEMENT);
|
||||
}
|
||||
KeAcquireSpinLockAtDpcLevel(&PagingFile->AllocMapLock);
|
||||
|
||||
RtlClearBit(PagingFile->AllocMap, off >> 5);
|
||||
|
||||
|
@ -313,7 +299,6 @@ MmFreeSwapPage(SWAPENTRY Entry)
|
|||
MiFreeSwapPages++;
|
||||
MiUsedSwapPages--;
|
||||
|
||||
KeReleaseSpinLockFromDpcLevel(&PagingFile->AllocMapLock);
|
||||
KeReleaseSpinLock(&PagingFileListLock, oldIrql);
|
||||
}
|
||||
|
||||
|
@ -339,7 +324,7 @@ MmAllocSwapPage(VOID)
|
|||
if (MmPagingFile[i] != NULL &&
|
||||
MmPagingFile[i]->FreePages >= 1)
|
||||
{
|
||||
off = MiAllocPageFromPagingFile(MmPagingFile[i]);
|
||||
off = RtlFindClearBitsAndSet(MmPagingFile[i]->AllocMap, 1, 0);
|
||||
if (off == 0xFFFFFFFF)
|
||||
{
|
||||
KeBugCheck(MEMORY_MANAGEMENT);
|
||||
|
@ -732,7 +717,6 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
|||
PagingFile->CurrentSize.QuadPart = SafeInitialSize.QuadPart;
|
||||
PagingFile->FreePages = (ULONG)(SafeInitialSize.QuadPart / PAGE_SIZE);
|
||||
PagingFile->UsedPages = 0;
|
||||
KeInitializeSpinLock(&PagingFile->AllocMapLock);
|
||||
PagingFile->PageFileName = PageFileName;
|
||||
|
||||
AllocMapSize = sizeof(RTL_BITMAP) + (((PagingFile->FreePages + 31) / 32) * sizeof(ULONG));
|
||||
|
|
Loading…
Reference in a new issue