mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:52:56 +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;
|
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
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
MmFreeSwapPage(SWAPENTRY Entry)
|
MmFreeSwapPage(SWAPENTRY Entry)
|
||||||
|
@ -303,7 +290,6 @@ MmFreeSwapPage(SWAPENTRY Entry)
|
||||||
{
|
{
|
||||||
KeBugCheck(MEMORY_MANAGEMENT);
|
KeBugCheck(MEMORY_MANAGEMENT);
|
||||||
}
|
}
|
||||||
KeAcquireSpinLockAtDpcLevel(&PagingFile->AllocMapLock);
|
|
||||||
|
|
||||||
RtlClearBit(PagingFile->AllocMap, off >> 5);
|
RtlClearBit(PagingFile->AllocMap, off >> 5);
|
||||||
|
|
||||||
|
@ -313,7 +299,6 @@ MmFreeSwapPage(SWAPENTRY Entry)
|
||||||
MiFreeSwapPages++;
|
MiFreeSwapPages++;
|
||||||
MiUsedSwapPages--;
|
MiUsedSwapPages--;
|
||||||
|
|
||||||
KeReleaseSpinLockFromDpcLevel(&PagingFile->AllocMapLock);
|
|
||||||
KeReleaseSpinLock(&PagingFileListLock, oldIrql);
|
KeReleaseSpinLock(&PagingFileListLock, oldIrql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +324,7 @@ MmAllocSwapPage(VOID)
|
||||||
if (MmPagingFile[i] != NULL &&
|
if (MmPagingFile[i] != NULL &&
|
||||||
MmPagingFile[i]->FreePages >= 1)
|
MmPagingFile[i]->FreePages >= 1)
|
||||||
{
|
{
|
||||||
off = MiAllocPageFromPagingFile(MmPagingFile[i]);
|
off = RtlFindClearBitsAndSet(MmPagingFile[i]->AllocMap, 1, 0);
|
||||||
if (off == 0xFFFFFFFF)
|
if (off == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
KeBugCheck(MEMORY_MANAGEMENT);
|
KeBugCheck(MEMORY_MANAGEMENT);
|
||||||
|
@ -732,7 +717,6 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
PagingFile->CurrentSize.QuadPart = SafeInitialSize.QuadPart;
|
PagingFile->CurrentSize.QuadPart = SafeInitialSize.QuadPart;
|
||||||
PagingFile->FreePages = (ULONG)(SafeInitialSize.QuadPart / PAGE_SIZE);
|
PagingFile->FreePages = (ULONG)(SafeInitialSize.QuadPart / PAGE_SIZE);
|
||||||
PagingFile->UsedPages = 0;
|
PagingFile->UsedPages = 0;
|
||||||
KeInitializeSpinLock(&PagingFile->AllocMapLock);
|
|
||||||
PagingFile->PageFileName = PageFileName;
|
PagingFile->PageFileName = PageFileName;
|
||||||
|
|
||||||
AllocMapSize = sizeof(RTL_BITMAP) + (((PagingFile->FreePages + 31) / 32) * sizeof(ULONG));
|
AllocMapSize = sizeof(RTL_BITMAP) + (((PagingFile->FreePages + 31) / 32) * sizeof(ULONG));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue