]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
#
+# LC_D_COMPARE_4ARGS
+#
+# Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
+# get rid of 'parent' argument of ->d_compare()
+#
+AC_DEFUN([LC_D_COMPARE_4ARGS], [
+LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
+d_compare_4args, [
+ #include <linux/dcache.h>
+],[
+ ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
+],[
+ AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
+ [d_compare need 4 arguments])
+])
+]) # LC_D_COMPARE_4ARGS
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# 4.8
LC_HAVE_POSIX_ACL_VALID_USER_NS
+ LC_D_COMPARE_4ARGS
#
AS_IF([test "x$enable_server" != xno], [
static int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
unsigned int len, const char *str,
const struct qstr *name)
+#elif defined(HAVE_D_COMPARE_4ARGS)
+static int ll_dcompare(const struct dentry *dentry, unsigned int len,
+ const char *str, const struct qstr *name)
#else
static int ll_dcompare(struct dentry *parent, struct qstr *d_name,
struct qstr *name)
#endif
{
-#if !defined(HAVE_D_COMPARE_7ARGS) && !defined(HAVE_D_COMPARE_5ARGS)
+#if !defined(HAVE_D_COMPARE_7ARGS) && !defined(HAVE_D_COMPARE_5ARGS) && !defined(HAVE_D_COMPARE_4ARGS)
/* XXX: (ugh !) d_name must be in-dentry structure */
struct dentry *dentry = container_of(d_name, struct dentry, d_name);
unsigned int len = d_name->len;