Linux 6.18: generic_drop_inode() and generic_delete_inode() renamed

Sponsored-by: https://despairlabs.com/sponsor/
Signed-off-by: Rob Norris <robn@despairlabs.com>
This commit is contained in:
Rob Norris 2025-09-29 09:51:06 +10:00 committed by Tony Hutter
parent 7730109762
commit aeff23939a
4 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,24 @@
dnl #
dnl # 6.18 API change
dnl # - generic_drop_inode() renamed to inode_generic_drop()
dnl # - generic_delete_inode() renamed to inode_just_drop()
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GENERIC_DROP], [
ZFS_LINUX_TEST_SRC([inode_generic_drop], [
#include <linux/fs.h>
],[
struct inode *ip = NULL;
inode_generic_drop(ip);
])
])
AC_DEFUN([ZFS_AC_KERNEL_INODE_GENERIC_DROP], [
AC_MSG_CHECKING([whether inode_generic_drop() exists])
ZFS_LINUX_TEST_RESULT([inode_generic_drop], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_INODE_GENERIC_DROP, 1,
[inode_generic_drop() exists])
],[
AC_MSG_RESULT(no)
])
])

View File

@ -137,6 +137,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR
ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE
ZFS_AC_KERNEL_SRC_NAMESPACE ZFS_AC_KERNEL_SRC_NAMESPACE
ZFS_AC_KERNEL_SRC_INODE_GENERIC_DROP
case "$host_cpu" in case "$host_cpu" in
powerpc*) powerpc*)
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
@ -258,6 +259,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR
ZFS_AC_KERNEL_SOPS_FREE_INODE ZFS_AC_KERNEL_SOPS_FREE_INODE
ZFS_AC_KERNEL_NAMESPACE ZFS_AC_KERNEL_NAMESPACE
ZFS_AC_KERNEL_INODE_GENERIC_DROP
case "$host_cpu" in case "$host_cpu" in
powerpc*) powerpc*)
ZFS_AC_KERNEL_CPU_HAS_FEATURE ZFS_AC_KERNEL_CPU_HAS_FEATURE

View File

@ -23,6 +23,7 @@
/* /*
* Copyright (C) 2011 Lawrence Livermore National Security, LLC. * Copyright (C) 2011 Lawrence Livermore National Security, LLC.
* Copyright (C) 2015 Jörg Thalheim. * Copyright (C) 2015 Jörg Thalheim.
* Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
*/ */
#ifndef _ZFS_VFS_H #ifndef _ZFS_VFS_H
@ -262,4 +263,10 @@ zpl_is_32bit_api(void)
#define zpl_generic_fillattr(user_ns, ip, sp) generic_fillattr(ip, sp) #define zpl_generic_fillattr(user_ns, ip, sp) generic_fillattr(ip, sp)
#endif #endif
#ifdef HAVE_INODE_GENERIC_DROP
/* 6.18 API change. These were renamed, alias the old names to the new. */
#define generic_delete_inode(ip) inode_just_drop(ip)
#define generic_drop_inode(ip) inode_generic_drop(ip)
#endif
#endif /* _ZFS_VFS_H */ #endif /* _ZFS_VFS_H */

View File

@ -23,6 +23,7 @@
* Copyright (c) 2011, Lawrence Livermore National Security, LLC. * Copyright (c) 2011, Lawrence Livermore National Security, LLC.
* Copyright (c) 2023, Datto Inc. All rights reserved. * Copyright (c) 2023, Datto Inc. All rights reserved.
* Copyright (c) 2025, Klara, Inc. * Copyright (c) 2025, Klara, Inc.
* Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
*/ */
@ -33,6 +34,7 @@
#include <sys/zpl.h> #include <sys/zpl.h>
#include <linux/iversion.h> #include <linux/iversion.h>
#include <linux/version.h> #include <linux/version.h>
#include <linux/vfs_compat.h>
/* /*
* What to do when the last reference to an inode is released. If 0, the kernel * What to do when the last reference to an inode is released. If 0, the kernel
@ -104,7 +106,7 @@ zpl_dirty_inode(struct inode *ip, int flags)
* reporting memory pressure and requests OpenZFS release some memory (see * reporting memory pressure and requests OpenZFS release some memory (see
* zfs_prune()). * zfs_prune()).
* *
* When set to 1, we call generic_delete_node(), which always returns "destroy * When set to 1, we call generic_delete_inode(), which always returns "destroy
* immediately", resulting in inodes being destroyed immediately, releasing * immediately", resulting in inodes being destroyed immediately, releasing
* their associated dnodes and dbufs to the dbuf cached and the ARC to be * their associated dnodes and dbufs to the dbuf cached and the ARC to be
* evicted as normal. * evicted as normal.