Lines Matching defs:folio
5087 * calling btrfs_invalidate_folio() against each folio of the inode. This
5094 * skip all those expensive operations on a per folio basis and do only
7888 static bool __btrfs_release_folio(struct folio *folio, gfp_t gfp_flags)
7890 int ret = try_release_extent_mapping(&folio->page, gfp_flags);
7893 wait_subpage_spinlock(&folio->page);
7894 clear_page_extent_mapped(&folio->page);
7899 static bool btrfs_release_folio(struct folio *folio, gfp_t gfp_flags)
7901 if (folio_test_writeback(folio) || folio_test_dirty(folio))
7903 return __btrfs_release_folio(folio, gfp_flags);
7908 struct folio *dst, struct folio *src,
7927 static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
7930 struct btrfs_inode *inode = BTRFS_I(folio->mapping->host);
7934 u64 page_start = folio_pos(folio);
7935 u64 page_end = page_start + folio_size(folio) - 1;
7940 * We have folio locked so no new ordered extent can be created on this
7941 * page, nor bio can be submitted for this folio.
7943 * But already submitted bio can still be finished on this folio.
7944 * Furthermore, endio function won't skip folio which has Ordered
7947 * on one folio.
7950 * do double ordered extent accounting on the same folio.
7952 folio_wait_writeback(folio);
7953 wait_subpage_spinlock(&folio->page);
7959 * If the range doesn't cover the full folio, we don't need to and
7960 * shouldn't clear page extent mapped, as folio->private can still
7963 * For cases that invalidate the full folio even the range doesn't
7964 * cover the full folio, like invalidating the last folio, we're
7967 if (!(offset == 0 && length == folio_size(folio))) {
7968 btrfs_release_folio(folio, GFP_NOFS);
8009 if (!btrfs_page_test_ordered(fs_info, &folio->page, cur, range_len)) {
8018 btrfs_page_clear_ordered(fs_info, &folio->page, cur, range_len);
8087 ASSERT(!folio_test_ordered(folio));
8088 btrfs_page_clear_checked(fs_info, &folio->page, folio_pos(folio), folio_size(folio));
8090 __btrfs_release_folio(folio, GFP_NOFS);
8091 clear_page_extent_mapped(&folio->page);