Lines Matching refs:folio
44 static bool afs_dir_release_folio(struct folio *folio, gfp_t gfp_flags);
45 static void afs_dir_invalidate_folio(struct folio *folio, size_t offset,
49 struct folio *folio) in afs_dir_dirty_folio() argument
113 struct folio *folio; in afs_dir_read_cleanup() local
122 xas_for_each(&xas, folio, last) { in afs_dir_read_cleanup()
123 if (xas_retry(&xas, folio)) in afs_dir_read_cleanup()
125 BUG_ON(xa_is_value(folio)); in afs_dir_read_cleanup()
126 ASSERTCMP(folio_file_mapping(folio), ==, mapping); in afs_dir_read_cleanup()
128 folio_put(folio); in afs_dir_read_cleanup()
137 static bool afs_dir_check_folio(struct afs_vnode *dvnode, struct folio *folio, in afs_dir_check_folio() argument
147 pos = folio_pos(folio); in afs_dir_check_folio()
151 size = min_t(loff_t, folio_size(folio), i_size - pos); in afs_dir_check_folio()
153 block = kmap_local_folio(folio, offset); in afs_dir_check_folio()
187 struct folio *folio; in afs_dir_dump() local
200 xas_for_each(&xas, folio, last) { in afs_dir_dump()
201 if (xas_retry(&xas, folio)) in afs_dir_dump()
204 BUG_ON(folio_file_mapping(folio) != mapping); in afs_dir_dump()
206 size = min_t(loff_t, folio_size(folio), req->actual_len - folio_pos(folio)); in afs_dir_dump()
208 block = kmap_local_folio(folio, offset); in afs_dir_dump()
209 pr_warn("[%02lx] %32phN\n", folio_index(folio) + offset, block); in afs_dir_dump()
221 struct folio *folio; in afs_dir_check() local
231 xas_for_each(&xas, folio, last) { in afs_dir_check()
232 if (xas_retry(&xas, folio)) in afs_dir_check()
235 BUG_ON(folio_file_mapping(folio) != mapping); in afs_dir_check()
237 if (!afs_dir_check_folio(dvnode, folio, req->actual_len)) { in afs_dir_check()
321 struct folio *folio; in afs_read_dir() local
323 folio = filemap_get_folio(mapping, i); in afs_read_dir()
324 if (!folio) { in afs_read_dir()
329 folio = __filemap_get_folio(mapping, in afs_read_dir()
332 if (!folio) in afs_read_dir()
334 folio_attach_private(folio, (void *)1); in afs_read_dir()
335 folio_unlock(folio); in afs_read_dir()
338 req->nr_pages += folio_nr_pages(folio); in afs_read_dir()
339 i += folio_nr_pages(folio); in afs_read_dir()
510 struct folio *folio; in afs_dir_iterate() local
536 folio = __filemap_get_folio(dir->i_mapping, ctx->pos / PAGE_SIZE, in afs_dir_iterate()
538 if (!folio) { in afs_dir_iterate()
543 offset = round_down(ctx->pos, sizeof(*dblock)) - folio_file_pos(folio); in afs_dir_iterate()
544 size = min_t(loff_t, folio_size(folio), in afs_dir_iterate()
545 req->actual_len - folio_file_pos(folio)); in afs_dir_iterate()
548 dblock = kmap_local_folio(folio, offset); in afs_dir_iterate()
550 folio_file_pos(folio) + offset); in afs_dir_iterate()
2020 static bool afs_dir_release_folio(struct folio *folio, gfp_t gfp_flags) in afs_dir_release_folio() argument
2022 struct afs_vnode *dvnode = AFS_FS_I(folio_inode(folio)); in afs_dir_release_folio()
2024 _enter("{{%llx:%llu}[%lu]}", dvnode->fid.vid, dvnode->fid.vnode, folio_index(folio)); in afs_dir_release_folio()
2026 folio_detach_private(folio); in afs_dir_release_folio()
2037 static void afs_dir_invalidate_folio(struct folio *folio, size_t offset, in afs_dir_invalidate_folio() argument
2040 struct afs_vnode *dvnode = AFS_FS_I(folio_inode(folio)); in afs_dir_invalidate_folio()
2042 _enter("{%lu},%zu,%zu", folio->index, offset, length); in afs_dir_invalidate_folio()
2044 BUG_ON(!folio_test_locked(folio)); in afs_dir_invalidate_folio()
2051 if (offset == 0 && length == folio_size(folio)) in afs_dir_invalidate_folio()
2052 folio_detach_private(folio); in afs_dir_invalidate_folio()