summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-09 20:06:03 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-09 20:06:03 +0100
commit65229a40828bb77e3ecd6085e9d4c0c3b39ce3d9 (patch)
tree7dcbf6032fc9c1d48310de3284ef07b54e175499
parenta22b7f96fc0e06748d6e8593ae0e232ca9e42ab1 (diff)
downloadserenity-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.cpp15
-rw-r--r--Kernel/VM/MemoryManager.h15
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 (&region.vmobject() == this)
- callback(region);
- }
- for (auto& region : MM.m_kernel_regions) {
- if (&region.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 (&region.vmobject() == this)
+ callback(region);
+ }
+ for (auto& region : MM.m_kernel_regions) {
+ if (&region.vmobject() == this)
+ callback(region);
+ }
+}