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
+6 -4
View File
@@ -456,12 +456,13 @@ int vfs_write_iovec(vnode_t *node, iovec_iterator_t *iovec_iterator, size_t size
vmmcache_makedirty(page);
*written += writesize;
pageoffset += 1;
pagecount -= 1;
if (flags & V_FFLAGS_NOCACHE)
err = writenocache(node, page, pageoffset * PAGE_SIZE);
pageoffset += 1;
pagecount -= 1;
pmm_release(FROM_HHDM(address));
if (err)
goto leave;
@@ -567,14 +568,15 @@ int vfs_read_iovec(vnode_t *node, iovec_iterator_t *iovec_iterator, size_t size,
}
*bytesread += readsize;
pageoffset += 1;
pagecount -= 1;
if (flags & V_FFLAGS_NOCACHE) {
// try to turn it into anonymous memory
vmmcache_evict(page);
}
pageoffset += 1;
pagecount -= 1;
pmm_release(FROM_HHDM(address));
}