Lines Matching refs:folio

12  * Attach a folio to the buffer and maybe set marks on it to say that we need
13 * to put the folio later and twiddle the pagecache flags.
16 struct folio *folio, unsigned int flags,
19 XA_STATE_ORDER(xas, xa, index, folio_order(folio));
24 xas_store(&xas, folio);
50 struct folio *folio;
57 /* TODO: Figure out what order folio can be allocated here */
58 folio = filemap_alloc_folio(readahead_gfp_mask(mapping), 0);
59 if (!folio)
61 folio->index = index;
62 ret = netfs_xa_store_and_mark(buffer, index, folio,
65 folio_put(folio);
69 index += folio_nr_pages(folio);
81 struct folio *folio;
85 xas_for_each_marked(&xas, folio, ULONG_MAX, NETFS_BUF_PUT_MARK) {
86 folio_put(folio);
93 * netfs_dirty_folio - Mark folio dirty and pin a cache object for writeback
94 * @mapping: The mapping the folio belongs to.
95 * @folio: The folio being dirtied.
97 * Set the dirty flag on a folio and pin an in-use cache object in memory so
101 * Return: true if the dirty flag was set on the folio, false otherwise.
103 bool netfs_dirty_folio(struct address_space *mapping, struct folio *folio)
112 if (!filemap_dirty_folio(mapping, folio))
170 * netfs_invalidate_folio - Invalidate or partially invalidate a folio
171 * @folio: Folio proposed for release
175 * Invalidate part or all of a folio for a network filesystem. The folio will
176 * be removed afterwards if the invalidated region covers the entire folio.
178 void netfs_invalidate_folio(struct folio *folio, size_t offset, size_t length)
181 size_t flen = folio_size(folio);
183 _enter("{%lx},%zx,%zx", folio->index, offset, length);
185 folio_wait_fscache(folio);
187 if (!folio_test_private(folio))
190 finfo = netfs_folio_info(folio);
218 netfs_put_group(netfs_folio_group(folio));
219 folio_detach_private(folio);
220 folio_clear_uptodate(folio);
233 * netfs_release_folio - Try to release a folio
234 * @folio: Folio proposed for release
237 * Request release of a folio and clean up its private state if it's not busy.
238 * Returns true if the folio can now be released, false if not
240 bool netfs_release_folio(struct folio *folio, gfp_t gfp)
242 struct netfs_inode *ctx = netfs_inode(folio_inode(folio));
245 end = folio_pos(folio) + folio_size(folio);
249 if (folio_test_private(folio))
251 if (folio_test_fscache(folio)) {
254 folio_wait_fscache(folio);