Lines Matching defs:folio
19 struct folio *folio;
47 xas_for_each(&xas, folio, last_page) {
52 if (xas_retry(&xas, folio))
55 pg_end = folio_pos(folio) + folio_size(folio) - 1;
66 folio_start_fscache(folio);
88 flush_dcache_folio(folio);
89 folio_mark_uptodate(folio);
93 if (folio_index(folio) == rreq->no_unlock_folio &&
97 folio_unlock(folio);
213 * @folio: The folio to read
224 int netfs_read_folio(struct file *file, struct folio *folio)
226 struct address_space *mapping = folio_file_mapping(folio);
231 _enter("%lx", folio_index(folio));
234 folio_file_pos(folio), folio_size(folio),
254 folio_unlock(folio);
260 * Prepare a folio for writing without reading first
261 * @folio: The folio being prepared
264 * @always_fill: T if the folio should always be completely filled/cleared
267 * - full folio write
268 * - write that lies in a folio that is completely beyond EOF
269 * - write that covers the folio from start to EOF or beyond it
272 * of the folio and return true. Otherwise, return false.
274 static bool netfs_skip_folio_read(struct folio *folio, loff_t pos, size_t len,
277 struct inode *inode = folio_inode(folio);
279 size_t offset = offset_in_folio(folio, pos);
280 size_t plen = folio_size(folio);
285 zero_user_segment(&folio->page, 0, plen);
286 folio_mark_uptodate(folio);
290 /* Full folio write */
298 /* Write that covers from the start of the folio to EOF or beyond */
304 zero_user_segments(&folio->page, 0, offset, offset + len, plen);
314 * @len: The length of the write (may extend beyond the end of the folio chosen)
315 * @_folio: Where to put the resultant folio
329 * conflicting writes once the folio is grabbed and locked. It is passed a
333 * folio, provided it sets ``*foliop`` to NULL, in which case a return of 0
334 * will cause the folio to be re-got and the process to be retried.
343 loff_t pos, unsigned int len, struct folio **_folio,
347 struct folio *folio;
354 folio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
356 if (IS_ERR(folio))
357 return PTR_ERR(folio);
361 ret = ctx->ops->check_write_begin(file, pos, len, &folio, _fsdata);
366 if (!folio)
370 if (folio_test_uptodate(folio))
378 netfs_skip_folio_read(folio, pos, len, false)) {
384 folio_file_pos(folio), folio_size(folio),
390 rreq->no_unlock_folio = folio_index(folio);
405 ractl._nr_pages = folio_nr_pages(folio);
408 /* We hold the folio locks, so we can drop the references */
409 folio_get(folio);
418 ret = folio_wait_fscache_killable(folio);
422 *_folio = folio;
429 if (folio) {
430 folio_unlock(folio);
431 folio_put(folio);