fix: obtain correct page table entry when performing eviction

This commit is contained in:
Themis Demetriades
2024-12-06 00:56:03 +00:00
parent 8220b931a9
commit 31403ac7cb
5 changed files with 8 additions and 7 deletions

View File

@@ -252,7 +252,7 @@ fetch_page (void *upage, bool write)
{
/* Check if the page is in the supplemental page table. That is, it is a page
that is expected to be in memory. */
struct page_entry *page = page_get (upage);
struct page_entry *page = page_get (thread_current (), upage);
if (page == NULL)
return false;

View File

@@ -462,7 +462,7 @@ syscall_mmap (int fd, void *addr)
hold the entire file. */
for (off_t ofs = 0; ofs < file_size; ofs += PGSIZE)
{
if (page_get (addr + ofs) != NULL)
if (page_get (thread_current (), addr + ofs) != NULL)
return MMAP_FAILURE;
}