kernel: random page cache fixes

This commit is contained in:
Matheus
2025-10-13 00:12:24 -03:00
parent 7f9dacedf0
commit 049b9c9ad6
2 changed files with 10 additions and 5 deletions
+4 -1
View File
@@ -185,7 +185,10 @@ int vmmcache_getpage(vnode_t *vnode, uintmax_t offset, page_t **res) {
return error;
}
HOLD_LOCK();
newpage->flags |= PAGE_FLAGS_READY;
RELEASE_LOCK();
EVENT_SIGNAL(&pagereadyevent);
*res = newpage;
}
@@ -335,7 +338,7 @@ int vmmcache_syncvnode(vnode_t *vnode, uintmax_t offset, size_t size) {
page_t *page = vnode->pages;
page_t *vnodedirtylist = NULL;
for (; page; page = page->vnodenext) {
if (page->offset < offset || page->offset >= top || (page->offset & PAGE_FLAGS_DIRTY) == 0)
if (page->offset < offset || page->offset >= top || (page->flags & PAGE_FLAGS_DIRTY) == 0)
continue;
// remove from write list and add to an internal list using the write pointers