--- /dev/null
+dnl #
+dnl # Linux 4.9-rc5+ ABI, removal of the .aio_fsync field
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_AIO_FSYNC], [
+ AC_MSG_CHECKING([whether fops->aio_fsync() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+
+ static const struct file_operations
+ fops __attribute__ ((unused)) = {
+ .aio_fsync = NULL,
+ };
+ ],[
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FILE_AIO_FSYNC, 1, [fops->aio_fsync() exists])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
ZFS_AC_KERNEL_NR_CACHED_OBJECTS
ZFS_AC_KERNEL_FREE_CACHED_OBJECTS
ZFS_AC_KERNEL_FALLOCATE
+ ZFS_AC_KERNEL_AIO_FSYNC
ZFS_AC_KERNEL_MKDIR_UMODE_T
ZFS_AC_KERNEL_LOOKUP_NAMEIDATA
ZFS_AC_KERNEL_CREATE_NAMEIDATA
return (error);
}
+#ifdef HAVE_FILE_AIO_FSYNC
static int
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
{
struct file *filp = kiocb->ki_filp;
return (zpl_fsync(filp, file_dentry(filp), datasync));
}
+#endif
+
#elif defined(HAVE_FSYNC_WITHOUT_DENTRY)
/*
* Linux 2.6.35 - 3.0 API,
return (error);
}
+#ifdef HAVE_FILE_AIO_FSYNC
static int
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
{
return (zpl_fsync(kiocb->ki_filp, datasync));
}
+#endif
+
#elif defined(HAVE_FSYNC_RANGE)
/*
* Linux 3.1 - 3.x API,
return (error);
}
+#ifdef HAVE_FILE_AIO_FSYNC
static int
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
{
return (zpl_fsync(kiocb->ki_filp, kiocb->ki_pos, -1, datasync));
}
+#endif
+
#else
#error "Unsupported fops->fsync() implementation"
#endif
#endif
.mmap = zpl_mmap,
.fsync = zpl_fsync,
+#ifdef HAVE_FILE_AIO_FSYNC
.aio_fsync = zpl_aio_fsync,
+#endif
#ifdef HAVE_FILE_FALLOCATE
.fallocate = zpl_fallocate,
#endif /* HAVE_FILE_FALLOCATE */