Lines Matching full:folios

201  * Folios that were pinned via memfd_pin_folios() or other similar routines
440 * unpin_folios() - release an array of gup-pinned folios.
441 * @folios: array of folios to be marked dirty and released.
442 * @nfolios: number of folios in the @folios array.
444 * For each folio in the @folios array, release the folio using gup_put_folio.
448 void unpin_folios(struct folio **folios, unsigned long nfolios) in unpin_folios() argument
453 * If this WARN_ON() fires, then the system *might* be leaking folios in unpin_folios()
463 if (folios[i] != folios[j]) in unpin_folios()
466 if (folios[i]) in unpin_folios()
467 gup_put_folio(folios[i], j - i, FOLL_PIN); in unpin_folios()
516 * FOLL_PIN on large folios: folio's refcount will be incremented by
519 * FOLL_PIN on single-page folios: folio's refcount will be incremented by
2221 * An array of either pages or folios ("pofs"). Although it may seem tempting to
2222 * avoid this complication, by simply interpreting a list of folios as a list of
2230 struct folio **folios; member
2240 return pofs->folios[i]; in pofs_get_folio()
2252 unpin_folios(pofs->folios, pofs->nr_entries); in pofs_unpin()
2283 * Returns the number of collected folios. Return value is always >= 0.
2328 * Unpins all folios and migrates device coherent folios and movable_folio_list.
2329 * Returns -EAGAIN if all folios were successfully migrated or -errno for
2361 * We can't migrate folios with unexpected references, so drop in migrate_longterm_unpinnable_folios()
2363 * Migrating folios have been added to movable_folio_list after in migrate_longterm_unpinnable_folios()
2412 * Check whether all folios are *allowed* to be pinned indefinitely (long term).
2413 * Rather confusingly, all folios in the range are required to be pinned via
2418 * 0: if everything is OK and all folios in the range are allowed to be pinned,
2419 * then this routine leaves all folios pinned and returns zero for success.
2421 * -EAGAIN: if any folios in the range are not allowed to be pinned, then this
2422 * routine will migrate those folios away, unpin all the folios in the range. If
2423 * migration of the entire set of folios succeeds, then -EAGAIN is returned. The
2429 * error back up the call stack. The caller does not need to unpin any folios in
2433 struct folio **folios) in check_and_migrate_movable_folios() argument
2436 .folios = folios, in check_and_migrate_movable_folios()
2467 struct folio **folios) in check_and_migrate_movable_folios() argument
2739 * GUP-fast must reject all secretmem folios.
2741 * Writing to pinned file-backed dirty tracked folios is inherently problematic
2767 /* secretmem folios are always order-0 folios. */ in gup_fast_folio_allowed()
2806 /* Anonymous folios pose no problem. */ in gup_fast_folio_allowed()
3434 * memfd_pin_folios() - pin folios associated with a memfd
3435 * @memfd: the memfd whose folios are to be pinned
3438 * @folios: array that receives pointers to the folios pinned
3439 * @max_folios: maximum number of entries in @folios
3442 * Attempt to pin folios associated with a memfd in the contiguous range
3444 * the folios can either be found in the page cache or need to be allocated
3445 * if necessary. Once the folios are located, they are all pinned via
3447 * And, eventually, these pinned folios must be released either using
3450 * It must be noted that the folios may be pinned for an indefinite amount
3455 * Returns number of folios pinned, which could be less than @max_folios
3457 * If no folios were pinned, it returns -errno.
3460 struct folio **folios, unsigned int max_folios, in memfd_pin_folios() argument
3501 * In most cases, we should be able to find the folios in memfd_pin_folios()
3516 folio = fbatch.folios[i]; in memfd_pin_folios()
3527 folios[nr_folios] = folio; in memfd_pin_folios()
3545 ret = check_and_migrate_movable_folios(nr_folios, folios); in memfd_pin_folios()
3552 unpin_folios(folios, nr_folios); in memfd_pin_folios()