Lines Matching +full:max +full:- +full:virtual +full:- +full:functions
1 /* SPDX-License-Identifier: GPL-2.0 */
14 #include "highmem-internal.h"
17 * kmap - Map a page for long term usage
20 * Returns: The virtual address of the mapping
26 * this returns the virtual address of the direct kernel mapping.
28 * The returned virtual address is globally visible and valid up to the
40 * kunmap - Unmap the virtual address mapped by kmap()
49 * kmap_to_page - Get the page for a kmap'ed address
57 * kmap_flush_unused - Flush all unused kmap mappings in order to
63 * kmap_local_page - Map a page for temporary usage
66 * Returns: The virtual address of the mapping
86 * virtual address of the direct mapping. Only real highmem pages are
93 * disabling migration in order to keep the virtual address stable across
99 * kmap_local_folio - Map a page in this folio for temporary usage
119 * virtual address of the direct mapping. Only real highmem pages are
126 * disabling migration in order to keep the virtual address stable across
130 * Return: The virtual address of @offset.
135 * kmap_atomic - Atomically map a page for temporary usage - Deprecated!
138 * Returns: The virtual address of the mapping
150 * example a page in the pagecache. The API has two functions, and they
212 * vma_alloc_zeroed_movable_folio - Allocate a zeroed page for a VMA.
214 * @vaddr: The virtual address the page will be inserted into.
217 * VMA at this virtual address. It may be allocated from highmem or
231 clear_user_highpage(&folio->page, vaddr); in vma_alloc_zeroed_movable_folio()
278 memset(kaddr + start1, 0, end1 - start1); in zero_user_segments()
281 memset(kaddr + start2, 0, end2 - start2); in zero_user_segments()
449 * memcpy_from_folio - Copy a range of bytes from a folio.
465 chunk > PAGE_SIZE - offset_in_page(offset)) in memcpy_from_folio()
466 chunk = PAGE_SIZE - offset_in_page(offset); in memcpy_from_folio()
472 len -= chunk; in memcpy_from_folio()
477 * memcpy_to_folio - Copy a range of bytes to a folio.
493 chunk > PAGE_SIZE - offset_in_page(offset)) in memcpy_to_folio()
494 chunk = PAGE_SIZE - offset_in_page(offset); in memcpy_to_folio()
500 len -= chunk; in memcpy_to_folio()
507 * folio_zero_tail - Zero the tail of a folio.
523 size_t len = folio_size(folio) - offset; in folio_zero_tail()
526 size_t max = PAGE_SIZE - offset_in_page(offset); in folio_zero_tail() local
528 while (len > max) { in folio_zero_tail()
529 memset(kaddr, 0, max); in folio_zero_tail()
531 len -= max; in folio_zero_tail()
532 offset += max; in folio_zero_tail()
533 max = PAGE_SIZE; in folio_zero_tail()
545 * folio_fill_tail - Copy some data to a folio and pad with zeroes.
564 size_t max = PAGE_SIZE - offset_in_page(offset); in folio_fill_tail() local
566 while (len > max) { in folio_fill_tail()
567 memcpy(to, from, max); in folio_fill_tail()
569 len -= max; in folio_fill_tail()
570 from += max; in folio_fill_tail()
571 offset += max; in folio_fill_tail()
572 max = PAGE_SIZE; in folio_fill_tail()
583 * memcpy_from_file_folio - Copy some bytes from a file folio.
602 len = min_t(size_t, len, PAGE_SIZE - offset); in memcpy_from_file_folio()
604 len = min(len, folio_size(folio) - offset); in memcpy_from_file_folio()
613 * folio_zero_segments() - Zero two byte ranges in a folio.
623 zero_user_segments(&folio->page, start1, xend1, start2, xend2); in folio_zero_segments()
627 * folio_zero_segment() - Zero a byte range in a folio.
635 zero_user_segments(&folio->page, start, xend, 0, 0); in folio_zero_segment()
639 * folio_zero_range() - Zero a byte range in a folio.
647 zero_user_segments(&folio->page, start, start + length, 0, 0); in folio_zero_range()
651 * folio_release_kmap - Unmap a folio and drop a refcount.