mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-06-25 02:28:01 +03:00
Linux 6.16: remove writepage and readahead_page
Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #17443
This commit is contained in:
parent
48ce292ea0
commit
46a4075100
23
config/kernel-pagemap-readahead-page.m4
Normal file
23
config/kernel-pagemap-readahead-page.m4
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 6.16 removed readahead_page
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_PAGEMAP_READAHEAD_PAGE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([pagemap_has_readahead_page], [
|
||||||
|
#include <linux/pagemap.h>
|
||||||
|
], [
|
||||||
|
struct page *p __attribute__ ((unused)) = NULL;
|
||||||
|
struct readahead_control *ractl __attribute__ ((unused)) = NULL;
|
||||||
|
p = readahead_page(ractl);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_PAGEMAP_READAHEAD_PAGE], [
|
||||||
|
AC_MSG_CHECKING([whether readahead_page() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([pagemap_has_readahead_page], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_PAGEMAP_READAHEAD_PAGE, 1,
|
||||||
|
[readahead_page() exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
24
config/kernel-vfs-writepage.m4
Normal file
24
config/kernel-vfs-writepage.m4
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Linux 6.16 removes address_space_operations ->writepage
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_WRITEPAGE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([vfs_has_writepage], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
|
||||||
|
static const struct address_space_operations
|
||||||
|
aops __attribute__ ((unused)) = {
|
||||||
|
.writepage = NULL,
|
||||||
|
};
|
||||||
|
],[])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_WRITEPAGE], [
|
||||||
|
AC_MSG_CHECKING([whether aops->writepage exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([vfs_has_writepage], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_VFS_WRITEPAGE, 1,
|
||||||
|
[address_space_operations->writepage exists])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
])
|
@ -82,6 +82,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_VFS_MIGRATEPAGE
|
ZFS_AC_KERNEL_SRC_VFS_MIGRATEPAGE
|
||||||
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
||||||
|
ZFS_AC_KERNEL_SRC_VFS_WRITEPAGE
|
||||||
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
||||||
@ -111,6 +112,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
||||||
ZFS_AC_KERNEL_SRC_STRLCPY
|
ZFS_AC_KERNEL_SRC_STRLCPY
|
||||||
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
||||||
|
ZFS_AC_KERNEL_SRC_PAGEMAP_READAHEAD_PAGE
|
||||||
ZFS_AC_KERNEL_SRC_ADD_DISK
|
ZFS_AC_KERNEL_SRC_ADD_DISK
|
||||||
ZFS_AC_KERNEL_SRC_KTHREAD
|
ZFS_AC_KERNEL_SRC_KTHREAD
|
||||||
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
||||||
@ -197,6 +199,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_VFS_MIGRATEPAGE
|
ZFS_AC_KERNEL_VFS_MIGRATEPAGE
|
||||||
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
||||||
ZFS_AC_KERNEL_VFS_READPAGES
|
ZFS_AC_KERNEL_VFS_READPAGES
|
||||||
|
ZFS_AC_KERNEL_VFS_WRITEPAGE
|
||||||
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
ZFS_AC_KERNEL_VFS_IOV_ITER
|
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||||
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
||||||
@ -226,6 +229,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
||||||
ZFS_AC_KERNEL_STRLCPY
|
ZFS_AC_KERNEL_STRLCPY
|
||||||
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
||||||
|
ZFS_AC_KERNEL_PAGEMAP_READAHEAD_PAGE
|
||||||
ZFS_AC_KERNEL_ADD_DISK
|
ZFS_AC_KERNEL_ADD_DISK
|
||||||
ZFS_AC_KERNEL_KTHREAD
|
ZFS_AC_KERNEL_KTHREAD
|
||||||
ZFS_AC_KERNEL_ZERO_PAGE
|
ZFS_AC_KERNEL_ZERO_PAGE
|
||||||
|
@ -8,6 +8,7 @@ kernel_linux_HEADERS = \
|
|||||||
%D%/kernel/linux/mm_compat.h \
|
%D%/kernel/linux/mm_compat.h \
|
||||||
%D%/kernel/linux/mod_compat.h \
|
%D%/kernel/linux/mod_compat.h \
|
||||||
%D%/kernel/linux/page_compat.h \
|
%D%/kernel/linux/page_compat.h \
|
||||||
|
%D%/kernel/linux/pagemap_compat.h \
|
||||||
%D%/kernel/linux/simd.h \
|
%D%/kernel/linux/simd.h \
|
||||||
%D%/kernel/linux/simd_aarch64.h \
|
%D%/kernel/linux/simd_aarch64.h \
|
||||||
%D%/kernel/linux/simd_arm.h \
|
%D%/kernel/linux/simd_arm.h \
|
||||||
|
36
include/os/linux/kernel/linux/pagemap_compat.h
Normal file
36
include/os/linux/kernel/linux/pagemap_compat.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// SPDX-License-Identifier: CDDL-1.0
|
||||||
|
/*
|
||||||
|
* CDDL HEADER START
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the terms of the
|
||||||
|
* Common Development and Distribution License (the "License").
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
*
|
||||||
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||||
|
* or https://opensource.org/licenses/CDDL-1.0.
|
||||||
|
* See the License for the specific language governing permissions
|
||||||
|
* and limitations under the License.
|
||||||
|
*
|
||||||
|
* When distributing Covered Code, include this CDDL HEADER in each
|
||||||
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||||
|
* If applicable, add the following below this CDDL HEADER, with the
|
||||||
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||||
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||||
|
*
|
||||||
|
* CDDL HEADER END
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ZFS_PAGEMAP_COMPAT_H
|
||||||
|
#define _ZFS_PAGEMAP_COMPAT_H
|
||||||
|
|
||||||
|
#include <linux/pagemap.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_PAGEMAP_READAHEAD_PAGE
|
||||||
|
#define readahead_page(ractl) (&(__readahead_folio(ractl)->page))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -36,10 +36,7 @@
|
|||||||
#include <sys/zfs_vfsops.h>
|
#include <sys/zfs_vfsops.h>
|
||||||
#include <sys/zfs_vnops.h>
|
#include <sys/zfs_vnops.h>
|
||||||
#include <sys/zfs_project.h>
|
#include <sys/zfs_project.h>
|
||||||
#if defined(HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS) || \
|
#include <linux/pagemap_compat.h>
|
||||||
defined(HAVE_VFS_FILEMAP_DIRTY_FOLIO)
|
|
||||||
#include <linux/pagemap.h>
|
|
||||||
#endif
|
|
||||||
#include <linux/fadvise.h>
|
#include <linux/fadvise.h>
|
||||||
#ifdef HAVE_VFS_FILEMAP_DIRTY_FOLIO
|
#ifdef HAVE_VFS_FILEMAP_DIRTY_FOLIO
|
||||||
#include <linux/writeback.h>
|
#include <linux/writeback.h>
|
||||||
@ -555,6 +552,7 @@ zpl_writepages(struct address_space *mapping, struct writeback_control *wbc)
|
|||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_VFS_WRITEPAGE
|
||||||
/*
|
/*
|
||||||
* Write out dirty pages to the ARC, this function is only required to
|
* Write out dirty pages to the ARC, this function is only required to
|
||||||
* support mmap(2). Mapped pages may be dirtied by memory operations
|
* support mmap(2). Mapped pages may be dirtied by memory operations
|
||||||
@ -571,6 +569,7 @@ zpl_writepage(struct page *pp, struct writeback_control *wbc)
|
|||||||
|
|
||||||
return (zpl_putpage(pp, wbc, &for_sync));
|
return (zpl_putpage(pp, wbc, &for_sync));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The flag combination which matches the behavior of zfs_space() is
|
* The flag combination which matches the behavior of zfs_space() is
|
||||||
@ -1063,7 +1062,9 @@ const struct address_space_operations zpl_address_space_operations = {
|
|||||||
#else
|
#else
|
||||||
.readpage = zpl_readpage,
|
.readpage = zpl_readpage,
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_VFS_WRITEPAGE
|
||||||
.writepage = zpl_writepage,
|
.writepage = zpl_writepage,
|
||||||
|
#endif
|
||||||
.writepages = zpl_writepages,
|
.writepages = zpl_writepages,
|
||||||
.direct_IO = zpl_direct_IO,
|
.direct_IO = zpl_direct_IO,
|
||||||
#ifdef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
#ifdef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||||
|
Loading…
Reference in New Issue
Block a user