aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2023-12-08 17:07:00 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2023-12-13 18:18:46 +0000
commit4e0d3f7b3c3295e51ded2bab39f36842f405b4eb (patch)
tree99ef136f0df2615c64577e367161e45bd8eb1473
parent50a56453dadbd05eb1c43addaf2773a1ef417445 (diff)
downloadsrc-4e0d3f7b3c3295e51ded2bab39f36842f405b4eb.tar.gz
src-4e0d3f7b3c3295e51ded2bab39f36842f405b4eb.zip
linuxkpi: Move `invalidate_mapping_pages()` to <linux/pagemap.h>
[Why] This is consistent with Linux. [How] The definition is moved from <linux/shmem_fs.h> to <linux/pagemap.h> and the latter is included from the former. This is how it is done on Linux. Prototypes are also expanded with argument names. I got a build failure in the DRM 5.18 drivers because the compiler considered that the `pgoff_t` argument was there twice. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D43018
-rw-r--r--sys/compat/linuxkpi/common/include/linux/pagemap.h6
-rw-r--r--sys/compat/linuxkpi/common/include/linux/shmem_fs.h15
2 files changed, 14 insertions, 7 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/pagemap.h b/sys/compat/linuxkpi/common/include/linux/pagemap.h
index aa2e2a4e3950..7244b61257dc 100644
--- a/sys/compat/linuxkpi/common/include/linux/pagemap.h
+++ b/sys/compat/linuxkpi/common/include/linux/pagemap.h
@@ -33,6 +33,12 @@
#include <linux/highmem.h>
#include <linux/vmalloc.h>
+#define invalidate_mapping_pages(...) \
+ linux_invalidate_mapping_pages(__VA_ARGS__)
+
+unsigned long linux_invalidate_mapping_pages(vm_object_t obj, pgoff_t start,
+ pgoff_t end);
+
static inline void
release_pages(struct page **pages, int nr)
{
diff --git a/sys/compat/linuxkpi/common/include/linux/shmem_fs.h b/sys/compat/linuxkpi/common/include/linux/shmem_fs.h
index eb31c5ad827a..d373cfa1d611 100644
--- a/sys/compat/linuxkpi/common/include/linux/shmem_fs.h
+++ b/sys/compat/linuxkpi/common/include/linux/shmem_fs.h
@@ -29,14 +29,15 @@
#ifndef _LINUXKPI_LINUX_SHMEM_FS_H_
#define _LINUXKPI_LINUX_SHMEM_FS_H_
-/* Shared memory support */
-unsigned long linux_invalidate_mapping_pages(vm_object_t, pgoff_t, pgoff_t);
-struct page *linux_shmem_read_mapping_page_gfp(vm_object_t, int, gfp_t);
-struct linux_file *linux_shmem_file_setup(const char *, loff_t, unsigned long);
-void linux_shmem_truncate_range(vm_object_t, loff_t, loff_t);
+#include <linux/pagemap.h>
-#define invalidate_mapping_pages(...) \
- linux_invalidate_mapping_pages(__VA_ARGS__)
+/* Shared memory support */
+struct page *linux_shmem_read_mapping_page_gfp(vm_object_t obj, int pindex,
+ gfp_t gfp);
+struct linux_file *linux_shmem_file_setup(const char *name, loff_t size,
+ unsigned long flags);
+void linux_shmem_truncate_range(vm_object_t obj, loff_t lstart,
+ loff_t lend);
#define shmem_read_mapping_page(...) \
linux_shmem_read_mapping_page_gfp(__VA_ARGS__, 0)