]> git.proxmox.com Git - mirror_zfs.git/blobdiff - config/kernel-dentry-operations.m4
Fix zdb crash
[mirror_zfs.git] / config / kernel-dentry-operations.m4
index dfbea7dfdda4fb6745390c864adc6429c162122d..61f5a27af5a782baef51f903794eecc60920d704 100644 (file)
@@ -5,11 +5,16 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
        AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/dcache.h>
-       ],[
-               int (*revalidate) (struct dentry *, struct nameidata *) = NULL;
-               struct dentry_operations dops __attribute__ ((unused)) = {
-                       .d_revalidate           = revalidate,
+               #include <linux/sched.h>
+
+               int revalidate (struct dentry *dentry,
+                   struct nameidata *nidata) { return 0; }
+
+               static const struct dentry_operations
+                   dops __attribute__ ((unused)) = {
+                       .d_revalidate   = revalidate,
                };
+       ],[
        ],[
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,