1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
From fe8b50f09fe69d3ae672d75593ec11b6d2b3f73f Mon Sep 17 00:00:00 2001
From: Rob Norris <robn@despairlabs.com>
Date: Mon, 29 Sep 2025 09:51:06 +1000
Subject: [PATCH 6/6] 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>
Last-Update: 2025-11-19
[john-cabaj: keeping only relevant copyright changes, and leaving out
changes to code comments in zpl_super.c as the context doesn't exist
in 2.3.4]
Signed-off-by: John Cabaj <john.cabaj@canonical.com>
---
config/kernel-drop-inode.m4 | 24 ++++++++++++++++++++++
config/kernel.m4 | 2 ++
include/os/linux/kernel/linux/vfs_compat.h | 7 +++++++
module/os/linux/zfs/zpl_super.c | 4 +++-
4 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 config/kernel-drop-inode.m4
--- /dev/null
+++ b/config/kernel-drop-inode.m4
@@ -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)
+ ])
+])
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -136,6 +136,7 @@
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_WB_ERR
ZFS_AC_KERNEL_SRC_SOPS_FREE_INODE
ZFS_AC_KERNEL_SRC_NAMESPACE
+ ZFS_AC_KERNEL_SRC_INODE_GENERIC_DROP
case "$host_cpu" in
powerpc*)
ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
@@ -256,6 +257,7 @@
ZFS_AC_KERNEL_SUPER_BLOCK_S_WB_ERR
ZFS_AC_KERNEL_SOPS_FREE_INODE
ZFS_AC_KERNEL_NAMESPACE
+ ZFS_AC_KERNEL_INODE_GENERIC_DROP
case "$host_cpu" in
powerpc*)
ZFS_AC_KERNEL_CPU_HAS_FEATURE
--- a/include/os/linux/kernel/linux/vfs_compat.h
+++ b/include/os/linux/kernel/linux/vfs_compat.h
@@ -23,6 +23,7 @@
/*
* Copyright (C) 2011 Lawrence Livermore National Security, LLC.
* Copyright (C) 2015 Jörg Thalheim.
+ * Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
*/
#ifndef _ZFS_VFS_H
@@ -262,4 +263,10 @@
#define zpl_generic_fillattr(user_ns, ip, sp) generic_fillattr(ip, sp)
#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 */
--- a/module/os/linux/zfs/zpl_super.c
+++ b/module/os/linux/zfs/zpl_super.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2011, Lawrence Livermore National Security, LLC.
* Copyright (c) 2023, Datto Inc. All rights reserved.
+ * Copyright (c) 2025, Rob Norris <robn@despairlabs.com>
*/
@@ -32,6 +33,7 @@
#include <sys/zpl.h>
#include <linux/iversion.h>
#include <linux/version.h>
+#include <linux/vfs_compat.h>
static struct inode *
|