Skip to content

Commit aa6ceb7

Browse files
robntonyhutter
authored andcommitted
Linux 6.14: dops->d_revalidate now takes four args
This is a convenience for filesystems that need the inode of their parent or their own name, as its often complicated to get that information. We don't need those things, so this is just detecting which prototype is expected and adjusting our callback to match. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Tony Hutter <[email protected]> (cherry picked from commit 7ef6b70)
1 parent 36225ba commit aa6ceb7

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

config/kernel-automount.m4

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dnl # solution to handling automounts. Prior to this cifs/nfs clients
55
dnl # which required automount support would abuse the follow_link()
66
dnl # operation on directories for this purpose.
77
dnl #
8-
AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
8+
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_AUTOMOUNT], [
99
ZFS_LINUX_TEST_SRC([dentry_operations_d_automount], [
1010
#include <linux/dcache.h>
1111
static struct vfsmount *d_automount(struct path *p) { return NULL; }
@@ -15,11 +15,48 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
1515
])
1616
])
1717

18-
AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
18+
AC_DEFUN([ZFS_AC_KERNEL_D_AUTOMOUNT], [
1919
AC_MSG_CHECKING([whether dops->d_automount() exists])
2020
ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [
2121
AC_MSG_RESULT(yes)
2222
],[
2323
ZFS_LINUX_TEST_ERROR([dops->d_automount()])
2424
])
2525
])
26+
27+
dnl #
28+
dnl # 6.14 API change
29+
dnl # dops->d_revalidate now has four args.
30+
dnl #
31+
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_4ARGS], [
32+
ZFS_LINUX_TEST_SRC([dentry_operations_d_revalidate_4args], [
33+
#include <linux/dcache.h>
34+
static int d_revalidate(struct inode *dir,
35+
const struct qstr *name, struct dentry *dentry,
36+
unsigned int fl) { return 0; }
37+
struct dentry_operations dops __attribute__ ((unused)) = {
38+
.d_revalidate = d_revalidate,
39+
};
40+
])
41+
])
42+
43+
AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_4ARGS], [
44+
AC_MSG_CHECKING([whether dops->d_revalidate() takes 4 args])
45+
ZFS_LINUX_TEST_RESULT([dentry_operations_d_revalidate_4args], [
46+
AC_MSG_RESULT(yes)
47+
AC_DEFINE(HAVE_D_REVALIDATE_4ARGS, 1,
48+
[dops->d_revalidate() takes 4 args])
49+
],[
50+
AC_MSG_RESULT(no)
51+
])
52+
])
53+
54+
AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
55+
ZFS_AC_KERNEL_SRC_D_AUTOMOUNT
56+
ZFS_AC_KERNEL_SRC_D_REVALIDATE_4ARGS
57+
])
58+
59+
AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
60+
ZFS_AC_KERNEL_D_AUTOMOUNT
61+
ZFS_AC_KERNEL_D_REVALIDATE_4ARGS
62+
])

module/os/linux/zfs/zpl_ctldir.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,14 @@ zpl_snapdir_automount(struct path *path)
185185
* as of the 3.18 kernel revaliding the mountpoint dentry will result in
186186
* the snapshot being immediately unmounted.
187187
*/
188+
#ifdef HAVE_D_REVALIDATE_4ARGS
189+
static int
190+
zpl_snapdir_revalidate(struct inode *dir, const struct qstr *name,
191+
struct dentry *dentry, unsigned int flags)
192+
#else
188193
static int
189194
zpl_snapdir_revalidate(struct dentry *dentry, unsigned int flags)
195+
#endif
190196
{
191197
return (!!dentry->d_inode);
192198
}

0 commit comments

Comments
 (0)