On Wed, Mar 04, 2020 at 11:58:27AM -0500, Vivek Goyal wrote: > > + /* If end == 0, all pages from start to till end of file */ > + if (!end) { > + end_idx = ULONG_MAX; > + len = 0; I find this a bit odd to specify end == 0 for ULONG_MAX... > } > +EXPORT_SYMBOL_GPL(dax_layout_busy_page_range); > + > +/** > + * dax_layout_busy_page - find first pinned page in @mapping > + * @mapping: address space to scan for a page with ref count > 1 > + * > + * DAX requires ZONE_DEVICE mapped pages. These pages are never > + * 'onlined' to the page allocator so they are considered idle when > + * page->count == 1. A filesystem uses this interface to determine if > + * any page in the mapping is busy, i.e. for DMA, or other > + * get_user_pages() usages. > + * > + * It is expected that the filesystem is holding locks to block the > + * establishment of new mappings in this address_space. I.e. it expects > + * to be able to run unmap_mapping_range() and subsequently not race > + * mapping_mapped() becoming true. > + */ > +struct page *dax_layout_busy_page(struct address_space *mapping) > +{ > + return dax_layout_busy_page_range(mapping, 0, 0); ... other functions I have seen specify ULONG_MAX here. Which IMO makes this call site more clear. Ira