mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
Kernel: Don't rewrite the whole file on sys$msync
This commit is contained in:
committed by
Andreas Kling
parent
259f78545a
commit
c7b90fa7d3
@@ -35,11 +35,13 @@ SharedInodeVMObject::SharedInodeVMObject(SharedInodeVMObject const& other)
|
||||
{
|
||||
}
|
||||
|
||||
ErrorOr<void> SharedInodeVMObject::sync()
|
||||
ErrorOr<void> SharedInodeVMObject::sync(off_t offset_in_pages, size_t pages)
|
||||
{
|
||||
SpinlockLocker locker(m_lock);
|
||||
|
||||
for (size_t page_index = 0; page_index < page_count(); ++page_index) {
|
||||
size_t highest_page_to_flush = min(page_count(), offset_in_pages + pages);
|
||||
|
||||
for (size_t page_index = offset_in_pages; page_index < highest_page_to_flush; ++page_index) {
|
||||
auto& physical_page = m_physical_pages[page_index];
|
||||
if (!physical_page)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user