mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
Kernel: Include the dirty bits when cloning an InodeVMObject
Now that (private) InodeVMObjects can be CoW-cloned on fork(), we need to make sure we clone the dirty bits as well.
This commit is contained in:
parent
0ef83911d7
commit
b614462079
Notes:
sideshowbarker
2024-07-19 08:57:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b6144620795
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ InodeVMObject::InodeVMObject(Inode& inode, size_t size)
|
|||
InodeVMObject::InodeVMObject(const InodeVMObject& other)
|
||||
: VMObject(other)
|
||||
, m_inode(other.m_inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
for (size_t i = 0; i < page_count(); ++i)
|
||||
m_dirty_pages.set(i, other.m_dirty_pages.get(i));
|
||||
}
|
||||
|
||||
InodeVMObject::~InodeVMObject()
|
||||
|
@ -51,7 +54,7 @@ InodeVMObject::~InodeVMObject()
|
|||
size_t InodeVMObject::amount_clean() const
|
||||
{
|
||||
size_t count = 0;
|
||||
ASSERT(page_count() == (size_t)m_dirty_pages.size());
|
||||
ASSERT(page_count() == m_dirty_pages.size());
|
||||
for (size_t i = 0; i < page_count(); ++i) {
|
||||
if (!m_dirty_pages.get(i) && m_physical_pages[i])
|
||||
++count;
|
||||
|
|
Loading…
Add table
Reference in a new issue