* Allocate a page in the specified object with the given page index. To * optimize insertion of the page into the object, the caller must also specifiy * the resident page in the object with largest index smaller than the given * page index, or NULL if no such page exists. */
| 1998 | * page index, or NULL if no such page exists. |
| 1999 | */ |
| 2000 | vm_page_t |
| 2001 | vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, |
| 2002 | int req, vm_page_t mpred) |
| 2003 | { |
| 2004 | struct vm_domainset_iter di; |
| 2005 | vm_page_t m; |
| 2006 | int domain; |
| 2007 | |
| 2008 | vm_domainset_iter_page_init(&di, object, pindex, &domain, &req); |
| 2009 | do { |
| 2010 | m = vm_page_alloc_domain_after(object, pindex, domain, req, |
| 2011 | mpred); |
| 2012 | if (m != NULL) |
| 2013 | break; |
| 2014 | } while (vm_domainset_iter_page(&di, object, &domain) == 0); |
| 2015 | |
| 2016 | return (m); |
| 2017 | } |
| 2018 | |
| 2019 | /* |
| 2020 | * Returns true if the number of free pages exceeds the minimum |
no test coverage detected