mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
mm: add memcpy_from_file_folio()
This is the equivalent of memcpy_from_page(). It differs in that it takes the position in a file instead of offset in a folio, it accepts the total number of bytes to be copied (instead of the number of bytes to be copied from this folio) and it returns how many bytes were copied from the folio, rather than making the caller calculate that and then checking if the caller got it right. [akpm@linux-foundation.org: fix typo in comment] Link: https://lkml.kernel.org/r/20230126201552.1681588-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: "Fabio M. De Francesco" <fmdefrancesco@gmail.com> Cc: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
3222d8c2a7
commit
00cdf76012
@@ -531,6 +531,7 @@ PAGEFLAG(Readahead, readahead, PF_NO_COMPOUND)
|
||||
* available at this point.
|
||||
*/
|
||||
#define PageHighMem(__p) is_highmem_idx(page_zonenum(__p))
|
||||
#define folio_test_highmem(__f) is_highmem_idx(folio_zonenum(__f))
|
||||
#else
|
||||
PAGEFLAG_FALSE(HighMem, highmem)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user