This is part of a series of patches intended to move busying out of consumers as much as possible.
There are several implementations of a function to lookup a page and call the pager if it is not yet valid. These functions sometimes differed in minor details. I have done my best to ensure that the differences were not important but I may have missed something. In particular, one consumer undirties the resulting page and would zero out valid memory from a fragment but I do not think this is correct.
Some call the pager has_page function and some do not. I think we don't ever want to call has_page for vnode objects. It is expensive and the vnode pagers will fill in zeros for sparse files anyway. The one difference here would be calling vm_pager_grab_valid() with an index beyond the end of the file. Today that would quietly zero fill a page. If we skip the has_page call the pager will return an error.
I also re-implemented part of vm_page_grab() here so that I could deal more cleanly with the busy acquire requirements as they relate to the valid field. This function is compatible with the end-goal of my patchset which is to allow busy/valid/dirty to proceed without the object lock.
I am looking for a little guidance on the details before I commit. In particular has_pages and dirty.