mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +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
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)
|
InodeVMObject::InodeVMObject(const InodeVMObject& other)
|
||||||
: VMObject(other)
|
: VMObject(other)
|
||||||
, m_inode(other.m_inode)
|
, 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()
|
InodeVMObject::~InodeVMObject()
|
||||||
|
@ -51,7 +54,7 @@ InodeVMObject::~InodeVMObject()
|
||||||
size_t InodeVMObject::amount_clean() const
|
size_t InodeVMObject::amount_clean() const
|
||||||
{
|
{
|
||||||
size_t count = 0;
|
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) {
|
for (size_t i = 0; i < page_count(); ++i) {
|
||||||
if (!m_dirty_pages.get(i) && m_physical_pages[i])
|
if (!m_dirty_pages.get(i) && m_physical_pages[i])
|
||||||
++count;
|
++count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue