Whamcloud - gitweb
LU-9183 llite: handle removal of parent argument of ->d_compare() 18/25818/13
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 2 Mar 2017 19:48:44 +0000 (22:48 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 28 Apr 2017 20:36:04 +0000 (20:36 +0000)
In commit 6fa67e707559303e086303aeecc9e8b91ef497d5 the parent
parameter for ->d_compare() was removed.

Change-Id: Ia241619c3ade13036154973a19f44a2083a9bc53
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: https://review.whamcloud.com/25818
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/llite/dcache.c

index 73160ae..2ea8caa 100644 (file)
@@ -2307,6 +2307,24 @@ posix_acl_valid, [
 ]) # 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
@@ -2497,6 +2515,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 4.8
        LC_HAVE_POSIX_ACL_VALID_USER_NS
+       LC_D_COMPARE_4ARGS
 
        #
        AS_IF([test "x$enable_server" != xno], [
index b9c3589..a8fb890 100644 (file)
@@ -88,12 +88,15 @@ static int ll_dcompare(const struct dentry *parent, const struct inode *pinode,
 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;