Lines Matching refs:xas

127 	XA_STATE(xas, &mapping->i_pages, page->index);  in page_cache_delete()
130 mapping_set_update(&xas, mapping); in page_cache_delete()
134 xas_set_order(&xas, page->index, compound_order(page)); in page_cache_delete()
142 xas_store(&xas, shadow); in page_cache_delete()
143 xas_init_marks(&xas); in page_cache_delete()
290 XA_STATE(xas, &mapping->i_pages, pvec->pages[0]->index); in page_cache_delete_batch()
295 mapping_set_update(&xas, mapping); in page_cache_delete_batch()
296 xas_for_each(&xas, page, ULONG_MAX) { in page_cache_delete_batch()
318 if (page->index == xas.xa_index) in page_cache_delete_batch()
327 if (page->index + compound_nr(page) - 1 == xas.xa_index) in page_cache_delete_batch()
329 xas_store(&xas, NULL); in page_cache_delete_batch()
486 XA_STATE(xas, &mapping->i_pages, start_byte >> PAGE_SHIFT); in filemap_range_has_page()
494 page = xas_find(&xas, max); in filemap_range_has_page()
495 if (xas_retry(&xas, page)) in filemap_range_has_page()
659 XA_STATE(xas, &mapping->i_pages, start_byte >> PAGE_SHIFT); in filemap_range_needs_writeback()
672 xas_for_each(&xas, page, max) { in filemap_range_needs_writeback()
673 if (xas_retry(&xas, page)) in filemap_range_needs_writeback()
841 XA_STATE(xas, &mapping->i_pages, offset); in replace_page_cache_page()
853 xas_lock_irq(&xas); in replace_page_cache_page()
854 xas_store(&xas, new); in replace_page_cache_page()
866 xas_unlock_irq(&xas); in replace_page_cache_page()
878 XA_STATE(xas, &mapping->i_pages, offset); in __add_to_page_cache_locked()
885 mapping_set_update(&xas, mapping); in __add_to_page_cache_locked()
901 unsigned int order = xa_get_order(xas.xa, xas.xa_index); in __add_to_page_cache_locked()
905 xas_split_alloc(&xas, xa_load(xas.xa, xas.xa_index), in __add_to_page_cache_locked()
907 xas_lock_irq(&xas); in __add_to_page_cache_locked()
908 xas_for_each_conflict(&xas, entry) { in __add_to_page_cache_locked()
911 xas_set_err(&xas, -EEXIST); in __add_to_page_cache_locked()
920 order = xa_get_order(xas.xa, xas.xa_index); in __add_to_page_cache_locked()
922 xas_split(&xas, old, order); in __add_to_page_cache_locked()
923 xas_reset(&xas); in __add_to_page_cache_locked()
927 xas_store(&xas, page); in __add_to_page_cache_locked()
928 if (xas_error(&xas)) in __add_to_page_cache_locked()
937 xas_unlock_irq(&xas); in __add_to_page_cache_locked()
938 } while (xas_nomem(&xas, gfp)); in __add_to_page_cache_locked()
940 if (xas_error(&xas)) { in __add_to_page_cache_locked()
941 error = xas_error(&xas); in __add_to_page_cache_locked()
1754 XA_STATE(xas, &mapping->i_pages, index); in page_cache_next_miss()
1757 void *entry = xas_next(&xas); in page_cache_next_miss()
1760 if (xas.xa_index == 0) in page_cache_next_miss()
1764 return xas.xa_index; in page_cache_next_miss()
1790 XA_STATE(xas, &mapping->i_pages, index); in page_cache_prev_miss()
1793 void *entry = xas_prev(&xas); in page_cache_prev_miss()
1796 if (xas.xa_index == ULONG_MAX) in page_cache_prev_miss()
1800 return xas.xa_index; in page_cache_prev_miss()
1820 XA_STATE(xas, &mapping->i_pages, index); in mapping_get_entry()
1825 xas_reset(&xas); in mapping_get_entry()
1826 page = xas_load(&xas); in mapping_get_entry()
1827 if (xas_retry(&xas, page)) in mapping_get_entry()
1844 if (unlikely(page != xas_reload(&xas))) { in mapping_get_entry()
1971 static inline struct page *find_get_entry(struct xa_state *xas, pgoff_t max, in find_get_entry() argument
1978 page = xas_find(xas, max); in find_get_entry()
1980 page = xas_find_marked(xas, max, mark); in find_get_entry()
1982 if (xas_retry(xas, page)) in find_get_entry()
1996 if (unlikely(page != xas_reload(xas))) { in find_get_entry()
2003 xas_reset(xas); in find_get_entry()
2036 XA_STATE(xas, &mapping->i_pages, start); in find_get_entries()
2042 while ((page = find_get_entry(&xas, end, XA_PRESENT))) { in find_get_entries()
2049 page = find_subpage(page, xas.xa_index); in find_get_entries()
2053 indices[ret] = xas.xa_index; in find_get_entries()
2088 XA_STATE(xas, &mapping->i_pages, start); in find_lock_entries()
2092 while ((page = find_get_entry(&xas, end, XA_PRESENT))) { in find_lock_entries()
2096 VM_BUG_ON_PAGE(page->index != xas.xa_index, page); in find_lock_entries()
2103 VM_BUG_ON_PAGE(!thp_contains(page, xas.xa_index), in find_lock_entries()
2106 indices[pvec->nr] = xas.xa_index; in find_lock_entries()
2119 xas_set(&xas, page->index + nr_pages); in find_lock_entries()
2120 if (xas.xa_index < nr_pages) in find_lock_entries()
2154 XA_STATE(xas, &mapping->i_pages, *start); in find_get_pages_range()
2162 while ((page = find_get_entry(&xas, end, XA_PRESENT))) { in find_get_pages_range()
2167 pages[ret] = find_subpage(page, xas.xa_index); in find_get_pages_range()
2169 *start = xas.xa_index + 1; in find_get_pages_range()
2205 XA_STATE(xas, &mapping->i_pages, index); in find_get_pages_contig()
2213 for (page = xas_load(&xas); page; page = xas_next(&xas)) { in find_get_pages_contig()
2214 if (xas_retry(&xas, page)) in find_get_pages_contig()
2227 if (unlikely(page != xas_reload(&xas))) in find_get_pages_contig()
2230 pages[ret] = find_subpage(page, xas.xa_index); in find_get_pages_contig()
2237 xas_reset(&xas); in find_get_pages_contig()
2263 XA_STATE(xas, &mapping->i_pages, *index); in find_get_pages_range_tag()
2271 while ((page = find_get_entry(&xas, end, tag))) { in find_get_pages_range_tag()
2336 XA_STATE(xas, &mapping->i_pages, index); in filemap_get_read_batch()
2340 for (head = xas_load(&xas); head; head = xas_next(&xas)) { in filemap_get_read_batch()
2341 if (xas_retry(&xas, head)) in filemap_get_read_batch()
2343 if (xas.xa_index > max || xa_is_value(head)) in filemap_get_read_batch()
2349 if (unlikely(head != xas_reload(&xas))) in filemap_get_read_batch()
2358 xas.xa_index = head->index + thp_nr_pages(head) - 1; in filemap_get_read_batch()
2359 xas.xa_offset = (xas.xa_index >> xas.xa_shift) & XA_CHUNK_MASK; in filemap_get_read_batch()
2364 xas_reset(&xas); in filemap_get_read_batch()
2783 static inline loff_t page_seek_hole_data(struct xa_state *xas, in page_seek_hole_data() argument
2795 xas_pause(xas); in page_seek_hole_data()
2816 unsigned int seek_page_size(struct xa_state *xas, struct page *page) in seek_page_size() argument
2819 return PAGE_SIZE << xa_get_order(xas->xa, xas->xa_index); in seek_page_size()
2844 XA_STATE(xas, &mapping->i_pages, start >> PAGE_SHIFT); in mapping_seek_hole_data()
2853 while ((page = find_get_entry(&xas, max, XA_PRESENT))) { in mapping_seek_hole_data()
2854 loff_t pos = (u64)xas.xa_index << PAGE_SHIFT; in mapping_seek_hole_data()
2863 seek_size = seek_page_size(&xas, page); in mapping_seek_hole_data()
2865 start = page_seek_hole_data(&xas, mapping, page, start, pos, in mapping_seek_hole_data()
2872 xas_set(&xas, pos >> PAGE_SHIFT); in mapping_seek_hole_data()
3228 struct xa_state *xas, pgoff_t end_pgoff) in next_uptodate_page() argument
3235 if (xas_retry(xas, page)) in next_uptodate_page()
3244 if (unlikely(page != xas_reload(xas))) in next_uptodate_page()
3257 if (xas->xa_index >= max_idx) in next_uptodate_page()
3264 } while ((page = xas_next_entry(xas, end_pgoff)) != NULL); in next_uptodate_page()
3270 struct xa_state *xas, in first_map_page() argument
3273 return next_uptodate_page(xas_find(xas, end_pgoff), in first_map_page()
3274 mapping, xas, end_pgoff); in first_map_page()
3278 struct xa_state *xas, in next_map_page() argument
3281 return next_uptodate_page(xas_next_entry(xas, end_pgoff), in next_map_page()
3282 mapping, xas, end_pgoff); in next_map_page()
3293 XA_STATE(xas, &mapping->i_pages, start_pgoff); in filemap_map_pages()
3299 head = first_map_page(mapping, &xas, end_pgoff); in filemap_map_pages()
3311 page = find_subpage(head, xas.xa_index); in filemap_map_pages()
3318 addr += (xas.xa_index - last_pgoff) << PAGE_SHIFT; in filemap_map_pages()
3319 vmf->pte += xas.xa_index - last_pgoff; in filemap_map_pages()
3320 last_pgoff = xas.xa_index; in filemap_map_pages()
3337 } while ((head = next_map_page(mapping, &xas, end_pgoff)) != NULL); in filemap_map_pages()