--- src/sys/vm/vm_page.c 2007/12/06 22:25:49 1.36 +++ src/sys/vm/vm_page.c 2008/04/16 18:05:09 1.36.2.1 @@ -1596,6 +1596,24 @@ vm_page_test_dirty(vm_page_t m) } } +/* + * Issue an event on a VM page. Corresponding action structures are + * removed from the page's list and called. + */ +void +vm_page_event_internal(vm_page_t m, vm_page_event_t event) +{ + struct vm_page_action *scan, *next; + + LIST_FOREACH_MUTABLE(scan, &m->action_list, entry, next) { + if (scan->event == event) { + scan->event = VMEVENT_NONE; + LIST_REMOVE(scan, entry); + scan->func(m, scan); + } + } +} + #include "opt_ddb.h" #ifdef DDB #include