• Home
  • Raw
  • Download

Lines Matching refs:folio

25 bool afs_dirty_folio(struct address_space *mapping, struct folio *folio)  in afs_dirty_folio()  argument
27 return fscache_dirty_folio(mapping, folio, in afs_dirty_folio()
30 static void afs_folio_start_fscache(bool caching, struct folio *folio) in afs_folio_start_fscache() argument
33 folio_start_fscache(folio); in afs_folio_start_fscache()
36 static void afs_folio_start_fscache(bool caching, struct folio *folio) in afs_folio_start_fscache() argument
49 struct folio *folio; in afs_write_begin() local
63 ret = netfs_write_begin(&vnode->netfs, file, mapping, pos, len, &folio, fsdata); in afs_write_begin()
67 index = folio_index(folio); in afs_write_begin()
75 if (folio_test_private(folio)) { in afs_write_begin()
76 priv = (unsigned long)folio_get_private(folio); in afs_write_begin()
77 f = afs_folio_dirty_from(folio, priv); in afs_write_begin()
78 t = afs_folio_dirty_to(folio, priv); in afs_write_begin()
81 if (folio_test_writeback(folio)) { in afs_write_begin()
82 trace_afs_folio_dirty(vnode, tracepoint_string("alrdy"), folio); in afs_write_begin()
94 *_page = folio_file_page(folio, pos / PAGE_SIZE); in afs_write_begin()
103 ret = folio_write_one(folio); in afs_write_begin()
107 ret = folio_lock_killable(folio); in afs_write_begin()
113 folio_put(folio); in afs_write_begin()
125 struct folio *folio = page_folio(subpage); in afs_write_end() local
128 unsigned int f, from = offset_in_folio(folio, pos); in afs_write_end()
133 vnode->fid.vid, vnode->fid.vnode, folio_index(folio)); in afs_write_end()
135 if (!folio_test_uptodate(folio)) { in afs_write_end()
141 folio_mark_uptodate(folio); in afs_write_end()
159 if (folio_test_private(folio)) { in afs_write_end()
160 priv = (unsigned long)folio_get_private(folio); in afs_write_end()
161 f = afs_folio_dirty_from(folio, priv); in afs_write_end()
162 t = afs_folio_dirty_to(folio, priv); in afs_write_end()
167 priv = afs_folio_dirty(folio, f, t); in afs_write_end()
168 folio_change_private(folio, (void *)priv); in afs_write_end()
169 trace_afs_folio_dirty(vnode, tracepoint_string("dirty+"), folio); in afs_write_end()
171 priv = afs_folio_dirty(folio, from, to); in afs_write_end()
172 folio_attach_private(folio, (void *)priv); in afs_write_end()
173 trace_afs_folio_dirty(vnode, tracepoint_string("dirty"), folio); in afs_write_end()
176 if (folio_mark_dirty(folio)) in afs_write_end()
177 _debug("dirtied %lx", folio_index(folio)); in afs_write_end()
180 folio_unlock(folio); in afs_write_end()
181 folio_put(folio); in afs_write_end()
192 struct folio *folio; in afs_kill_pages() local
202 folio = filemap_get_folio(mapping, index); in afs_kill_pages()
203 if (!folio) { in afs_kill_pages()
208 next = folio_next_index(folio); in afs_kill_pages()
210 folio_clear_uptodate(folio); in afs_kill_pages()
211 folio_end_writeback(folio); in afs_kill_pages()
212 folio_lock(folio); in afs_kill_pages()
213 generic_error_remove_page(mapping, &folio->page); in afs_kill_pages()
214 folio_unlock(folio); in afs_kill_pages()
215 folio_put(folio); in afs_kill_pages()
230 struct folio *folio; in afs_redirty_pages() local
240 folio = filemap_get_folio(mapping, index); in afs_redirty_pages()
241 if (!folio) { in afs_redirty_pages()
246 next = index + folio_nr_pages(folio); in afs_redirty_pages()
247 folio_redirty_for_writepage(wbc, folio); in afs_redirty_pages()
248 folio_end_writeback(folio); in afs_redirty_pages()
249 folio_put(folio); in afs_redirty_pages()
261 struct folio *folio; in afs_pages_written_back() local
272 xas_for_each(&xas, folio, end) { in afs_pages_written_back()
273 if (!folio_test_writeback(folio)) { in afs_pages_written_back()
275 len, start, folio_index(folio), end); in afs_pages_written_back()
276 ASSERT(folio_test_writeback(folio)); in afs_pages_written_back()
279 trace_afs_folio_dirty(vnode, tracepoint_string("clear"), folio); in afs_pages_written_back()
280 folio_detach_private(folio); in afs_pages_written_back()
281 folio_end_writeback(folio); in afs_pages_written_back()
439 struct folio *folio; in afs_extend_writeback() local
458 xas_for_each(&xas, folio, ULONG_MAX) { in afs_extend_writeback()
460 if (xas_retry(&xas, folio)) in afs_extend_writeback()
462 if (xa_is_value(folio)) in afs_extend_writeback()
464 if (folio_index(folio) != index) in afs_extend_writeback()
467 if (!folio_try_get_rcu(folio)) { in afs_extend_writeback()
473 if (unlikely(folio != xas_reload(&xas))) { in afs_extend_writeback()
474 folio_put(folio); in afs_extend_writeback()
478 if (!folio_trylock(folio)) { in afs_extend_writeback()
479 folio_put(folio); in afs_extend_writeback()
482 if (!folio_test_dirty(folio) || in afs_extend_writeback()
483 folio_test_writeback(folio) || in afs_extend_writeback()
484 folio_test_fscache(folio)) { in afs_extend_writeback()
485 folio_unlock(folio); in afs_extend_writeback()
486 folio_put(folio); in afs_extend_writeback()
490 psize = folio_size(folio); in afs_extend_writeback()
491 priv = (unsigned long)folio_get_private(folio); in afs_extend_writeback()
492 f = afs_folio_dirty_from(folio, priv); in afs_extend_writeback()
493 t = afs_folio_dirty_to(folio, priv); in afs_extend_writeback()
495 folio_unlock(folio); in afs_extend_writeback()
496 folio_put(folio); in afs_extend_writeback()
507 index += folio_nr_pages(folio); in afs_extend_writeback()
508 if (!pagevec_add(&pvec, &folio->page)) in afs_extend_writeback()
525 folio = page_folio(pvec.pages[i]); in afs_extend_writeback()
526 trace_afs_folio_dirty(vnode, tracepoint_string("store+"), folio); in afs_extend_writeback()
528 if (!folio_clear_dirty_for_io(folio)) in afs_extend_writeback()
530 if (folio_start_writeback(folio)) in afs_extend_writeback()
532 afs_folio_start_fscache(caching, folio); in afs_extend_writeback()
534 *_count -= folio_nr_pages(folio); in afs_extend_writeback()
535 folio_unlock(folio); in afs_extend_writeback()
551 struct folio *folio, in afs_write_back_from_locked_folio() argument
564 _enter(",%lx,%llx-%llx", folio_index(folio), start, end); in afs_write_back_from_locked_folio()
566 if (folio_start_writeback(folio)) in afs_write_back_from_locked_folio()
568 afs_folio_start_fscache(caching, folio); in afs_write_back_from_locked_folio()
570 count -= folio_nr_pages(folio); in afs_write_back_from_locked_folio()
577 priv = (unsigned long)folio_get_private(folio); in afs_write_back_from_locked_folio()
578 offset = afs_folio_dirty_from(folio, priv); in afs_write_back_from_locked_folio()
579 to = afs_folio_dirty_to(folio, priv); in afs_write_back_from_locked_folio()
580 trace_afs_folio_dirty(vnode, tracepoint_string("store"), folio); in afs_write_back_from_locked_folio()
593 (to == folio_size(folio) || new_content)) in afs_write_back_from_locked_folio()
604 folio_unlock(folio); in afs_write_back_from_locked_folio()
674 struct folio *folio = page_folio(subpage); in afs_writepage() local
678 _enter("{%lx},", folio_index(folio)); in afs_writepage()
681 folio_wait_fscache(folio); in afs_writepage()
684 start = folio_index(folio) * PAGE_SIZE; in afs_writepage()
685 ret = afs_write_back_from_locked_folio(folio_mapping(folio), wbc, in afs_writepage()
686 folio, start, LLONG_MAX - start); in afs_writepage()
703 struct folio *folio; in afs_writepages_region() local
718 folio = page_folio(head_page); in afs_writepages_region()
719 start = folio_pos(folio); /* May regress with THPs */ in afs_writepages_region()
721 _debug("wback %lx", folio_index(folio)); in afs_writepages_region()
729 ret = folio_lock_killable(folio); in afs_writepages_region()
731 folio_put(folio); in afs_writepages_region()
735 if (!folio_trylock(folio)) { in afs_writepages_region()
736 folio_put(folio); in afs_writepages_region()
741 if (folio_mapping(folio) != mapping || in afs_writepages_region()
742 !folio_test_dirty(folio)) { in afs_writepages_region()
743 start += folio_size(folio); in afs_writepages_region()
744 folio_unlock(folio); in afs_writepages_region()
745 folio_put(folio); in afs_writepages_region()
749 if (folio_test_writeback(folio) || in afs_writepages_region()
750 folio_test_fscache(folio)) { in afs_writepages_region()
751 folio_unlock(folio); in afs_writepages_region()
753 folio_wait_writeback(folio); in afs_writepages_region()
755 folio_wait_fscache(folio); in afs_writepages_region()
758 start += folio_size(folio); in afs_writepages_region()
760 folio_put(folio); in afs_writepages_region()
769 if (!folio_clear_dirty_for_io(folio)) in afs_writepages_region()
771 ret = afs_write_back_from_locked_folio(mapping, wbc, folio, start, end); in afs_writepages_region()
772 folio_put(folio); in afs_writepages_region()
896 struct folio *folio = page_folio(vmf->page); in afs_page_mkwrite() local
904 _enter("{{%llx:%llu}},{%lx}", vnode->fid.vid, vnode->fid.vnode, folio_index(folio)); in afs_page_mkwrite()
914 if (folio_test_fscache(folio) && in afs_page_mkwrite()
915 folio_wait_fscache_killable(folio) < 0) in afs_page_mkwrite()
919 if (folio_wait_writeback_killable(folio)) in afs_page_mkwrite()
922 if (folio_lock_killable(folio) < 0) in afs_page_mkwrite()
929 if (folio_wait_writeback_killable(folio) < 0) { in afs_page_mkwrite()
930 folio_unlock(folio); in afs_page_mkwrite()
934 priv = afs_folio_dirty(folio, 0, folio_size(folio)); in afs_page_mkwrite()
936 if (folio_test_private(folio)) { in afs_page_mkwrite()
937 folio_change_private(folio, (void *)priv); in afs_page_mkwrite()
938 trace_afs_folio_dirty(vnode, tracepoint_string("mkwrite+"), folio); in afs_page_mkwrite()
940 folio_attach_private(folio, (void *)priv); in afs_page_mkwrite()
941 trace_afs_folio_dirty(vnode, tracepoint_string("mkwrite"), folio); in afs_page_mkwrite()
982 int afs_launder_folio(struct folio *folio) in afs_launder_folio() argument
984 struct afs_vnode *vnode = AFS_FS_I(folio_inode(folio)); in afs_launder_folio()
991 _enter("{%lx}", folio->index); in afs_launder_folio()
993 priv = (unsigned long)folio_get_private(folio); in afs_launder_folio()
994 if (folio_clear_dirty_for_io(folio)) { in afs_launder_folio()
996 t = folio_size(folio); in afs_launder_folio()
997 if (folio_test_private(folio)) { in afs_launder_folio()
998 f = afs_folio_dirty_from(folio, priv); in afs_launder_folio()
999 t = afs_folio_dirty_to(folio, priv); in afs_launder_folio()
1002 bv[0].bv_page = &folio->page; in afs_launder_folio()
1007 trace_afs_folio_dirty(vnode, tracepoint_string("launder"), folio); in afs_launder_folio()
1008 ret = afs_store_data(vnode, &iter, folio_pos(folio) + f, true); in afs_launder_folio()
1011 trace_afs_folio_dirty(vnode, tracepoint_string("laundered"), folio); in afs_launder_folio()
1012 folio_detach_private(folio); in afs_launder_folio()
1013 folio_wait_fscache(folio); in afs_launder_folio()