On Tue, Jul 07, 2020 at 05:39:04AM +0100, Matthew Wilcox wrote: > although I think you have a simpler task. > > XA_STATE(xas, ..., start_index); > > for (;;) { > struct page *page = xas_next(&xas); > > if (!page || (~page->vm_max_prot_bits & vm_prot_bits)) > return -EACCES; > } > > return 0; > > should do the trick, I think. Ah, neato. Thanks!