Skip to content

Commit

Permalink
Kernel: Cleanup duplicated code
Browse files Browse the repository at this point in the history
There are 2 functions in InodeVMObject that are almost identical.
This commit makes them both use the same code path.
  • Loading branch information
brody-qq committed Jun 9, 2024
1 parent d1a997b commit ca29480
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Kernel/Memory/InodeVMObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,7 @@ size_t InodeVMObject::amount_dirty() const

int InodeVMObject::release_all_clean_pages()
{
SpinlockLocker locker(m_lock);

int count = 0;
for (size_t i = 0; i < page_count(); ++i) {
if (!m_dirty_pages.get(i) && m_physical_pages[i]) {
m_physical_pages[i] = nullptr;
++count;
}
}
if (count)
remap_regions();
return count;
return try_release_clean_pages(page_count());
}

int InodeVMObject::try_release_clean_pages(int page_amount)
Expand Down

0 comments on commit ca29480

Please sign in to comment.