On Wed, Aug 07, 2024 at 04:28:53PM GMT, Matthew Wilcox wrote: > On Tue, Jul 30, 2024 at 01:39:06PM -0700, Andrii Nakryiko wrote: > > + union { > > + struct { > > + struct address_space *mapping; > > + struct page *page; > > NAK. All the page-based interfaces are deprecated. Only we can't mark > them as deprecated because our tooling is a pile of crap. > > > + void *page_addr; > > + u64 file_off; > > loff_t pos. > > > + r->page = find_get_page(r->mapping, pg_off); > > r->folio = read_mapping_folio(r->mapping, r->pos / PAGE_SIZE, ...) > > OK, for network filesystems, you're going to need to retain the struct > file that's used to access them. So maybe this becomes > read_mapping_folio(r->file->f_mapping, r->pos, r->file) This code path can be called from non-sleepable context. What would be the appropriate way to get the folio in that case? > > > + r->page_addr = kmap_local_page(r->page); > > kmap_local_folio(r->folio, offset_in_folio(r->folio, r->pos)); >