Explorar o código

Kernel: Move VMObject::for_each_region() to MemoryManager.h

It can't be in VMObject.h since it depends on MemoryManager.h
Andreas Kling %!s(int64=5) %!d(string=hai) anos
pai
achega
65229a4082
Modificáronse 2 ficheiros con 15 adicións e 15 borrados
  1. 0 15
      Kernel/VM/InodeVMObject.cpp
  2. 15 0
      Kernel/VM/MemoryManager.h

+ 0 - 15
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);
-    }
-}

+ 15 - 0
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);
+    }
+}