diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-12-09 20:06:03 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-09 20:06:03 +0100 |
commit | 65229a40828bb77e3ecd6085e9d4c0c3b39ce3d9 (patch) | |
tree | 7dcbf6032fc9c1d48310de3284ef07b54e175499 | |
parent | a22b7f96fc0e06748d6e8593ae0e232ca9e42ab1 (diff) | |
download | serenity-65229a40828bb77e3ecd6085e9d4c0c3b39ce3d9.zip |
Kernel: Move VMObject::for_each_region() to MemoryManager.h
It can't be in VMObject.h since it depends on MemoryManager.h
-rw-r--r-- | Kernel/VM/InodeVMObject.cpp | 15 | ||||
-rw-r--r-- | Kernel/VM/MemoryManager.h | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/Kernel/VM/InodeVMObject.cpp b/Kernel/VM/InodeVMObject.cpp index 93bcc65bf3..eb8f9d39f6 100644 --- a/Kernel/VM/InodeVMObject.cpp +++ b/Kernel/VM/InodeVMObject.cpp @@ -102,18 +102,3 @@ void InodeVMObject::inode_contents_changed(Badge<Inode>, off_t offset, ssize_t s region.remap(); }); } - -template<typename Callback> -void VMObject::for_each_region(Callback callback) -{ - // FIXME: Figure out a better data structure so we don't have to walk every single region every time an inode changes. - // Perhaps VMObject could have a Vector<Region*> with all of his mappers? - for (auto& region : MM.m_user_regions) { - if (®ion.vmobject() == this) - callback(region); - } - for (auto& region : MM.m_kernel_regions) { - if (®ion.vmobject() == this) - callback(region); - } -} diff --git a/Kernel/VM/MemoryManager.h b/Kernel/VM/MemoryManager.h index b4c7cac06d..816c7d4fdb 100644 --- a/Kernel/VM/MemoryManager.h +++ b/Kernel/VM/MemoryManager.h @@ -138,3 +138,18 @@ struct ProcessPagingScope { ProcessPagingScope(Process&); ~ProcessPagingScope(); }; + +template<typename Callback> +void VMObject::for_each_region(Callback callback) +{ + // FIXME: Figure out a better data structure so we don't have to walk every single region every time an inode changes. + // Perhaps VMObject could have a Vector<Region*> with all of his mappers? + for (auto& region : MM.m_user_regions) { + if (®ion.vmobject() == this) + callback(region); + } + for (auto& region : MM.m_kernel_regions) { + if (®ion.vmobject() == this) + callback(region); + } +} |