fix: use correct page_get function within page eviction

This commit is contained in:
Themis Demetriades
2024-12-06 01:43:41 +00:00
parent 96b350d623
commit 3897e83963

View File

@@ -96,7 +96,7 @@ frame_alloc (enum palloc_flags flags, void *upage, struct thread *owner)
ASSERT (victim != NULL); /* get_victim () should never return null. */ ASSERT (victim != NULL); /* get_victim () should never return null. */
/* 2. Handle victim page writing based on its type. */ /* 2. Handle victim page writing based on its type. */
struct page_entry *victim_page = page_get (victim->upage); struct page_entry *victim_page = page_get (thread_current (), victim->upage);
if (victim_page != NULL && victim_page->type == PAGE_MMAP) if (victim_page != NULL && victim_page->type == PAGE_MMAP)
{ {
/* If it was a memory-mapped file page, we just write it back /* If it was a memory-mapped file page, we just write it back