From c27e25b5cabd20f0344cedd8619c4782dd42b006 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Fri, 13 Sep 2024 19:15:38 +0200 Subject: [PATCH] lx_emul: shmem_file.h adapt to folio changes Everything related to compound pages is gradually removed and replaced with folios. issue #5264 --- .../src/include/lx_emul/shmem_file.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/repos/dde_linux/src/include/lx_emul/shmem_file.h b/repos/dde_linux/src/include/lx_emul/shmem_file.h index fcced61a15..ec81ecb0e0 100644 --- a/repos/dde_linux/src/include/lx_emul/shmem_file.h +++ b/repos/dde_linux/src/include/lx_emul/shmem_file.h @@ -91,8 +91,15 @@ err_inode: } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0) +#define folio_cast struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, pgoff_t index, gfp_t gfp) +#else +#define folio_cast (struct folio *) +struct folio *shmem_read_folio_gfp(struct address_space *mapping, + pgoff_t index, gfp_t gfp) +#endif { struct page *p; struct shmem_file_buffer *private_data; @@ -103,17 +110,27 @@ struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, private_data = mapping->private_data; p = private_data->pages; - return (p + index); + return folio_cast(p + index); } #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0) void __pagevec_release(struct pagevec * pvec) { /* XXX check if we have to call release_pages */ pagevec_reinit(pvec); } +#else +void __folio_batch_release(struct folio_batch *fbatch) +{ + lx_emul_trace(__func__); + + /* XXX check if we have to call release_pages */ + folio_batch_reinit(fbatch); +} +#endif #include