|
@@ -138,3 +138,18 @@ struct ProcessPagingScope {
|
|
ProcessPagingScope(Process&);
|
|
ProcessPagingScope(Process&);
|
|
~ProcessPagingScope();
|
|
~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);
|
|
|
|
+ }
|
|
|
|
+}
|