From f8d40497bd3604a794a16f0d40d423d33e6d3bce Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 1 May 2025 15:10:57 -0400 Subject: [PATCH] Obsolete scoutfs_writepage Due to folios, the kernel will call scoutfs_writepages() and this becomes unused. It could be ported but the helper function to call isn't exported anymore. Signed-off-by: Auke Kok --- kmod/src/Makefile.kernelcompat | 11 +++++++++++ kmod/src/data.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index f7272401..7ed412b8 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -587,3 +587,14 @@ endif ifneq (,$(shell grep 'int buffer_migrate_folio.struct address_space' include/linux/buffer_head.h)) ccflags-y += -DKC_HAVE_BUFFER_MIGRATE_FOLIO endif + +# +# v6.7-rc4-307-g17bf23a981be +# +# block_write_full_page() is replaced with block_write_full_folio(), +# but that isn't exported as it used to be (and the only users now +# are builtin). However, the kernel will fall back to using the +# .writepages method instead, so we can drop this method. +ifneq (,$(shell grep 'int block_write_full_page.struct page' include/linux/buffer_head.h)) +ccflags-y += -DKC_HAVE_BLOCK_WRITE_FULL_PAGE +endif diff --git a/kmod/src/data.c b/kmod/src/data.c index 623080c2..78fb96f6 100644 --- a/kmod/src/data.c +++ b/kmod/src/data.c @@ -830,10 +830,12 @@ static void scoutfs_readahead(struct readahead_control *rac) } #endif +#ifdef KC_HAVE_BLOCK_WRITE_FULL_PAGE static int scoutfs_writepage(struct page *page, struct writeback_control *wbc) { return block_write_full_page(page, scoutfs_get_block_write, wbc); } +#endif static int scoutfs_writepages(struct address_space *mapping, struct writeback_control *wbc) @@ -2313,7 +2315,9 @@ const struct address_space_operations scoutfs_file_aops = { #else .readahead = scoutfs_readahead, #endif +#ifdef KC_HAVE_BLOCK_WRITE_FULL_PAGE .writepage = scoutfs_writepage, +#endif .writepages = scoutfs_writepages, .write_begin = scoutfs_write_begin, .write_end = scoutfs_write_end,