])
#
+# 3.11 dentry_operations.d_compare() taken 5 arguments.
+#
+AC_DEFUN([LC_D_COMPARE_5ARGS],
+[AC_MSG_CHECKING([if d_compare taken 5 arguments])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/dcache.h>
+],[
+ ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
+],[
+ AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
+ [d_compare need 5 arguments])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
# 3.11 need to access d_count to get dentry reference count
#
AC_DEFUN([LC_HAVE_DCOUNT],
LC_BLKDEV_RELEASE_RETURN_INT
# 3.11
+ LC_D_COMPARE_5ARGS
LC_HAVE_DCOUNT
#
int ll_dcompare(const struct dentry *parent, const struct inode *pinode,
const struct dentry *dentry, const struct inode *inode,
unsigned int len, const char *str, const struct qstr *name)
+#elif defined(HAVE_D_COMPARE_5ARGS)
+int ll_dcompare(const struct dentry *parent, const struct dentry *dentry,
+ unsigned int len, const char *str, const struct qstr *name)
#else
int ll_dcompare(struct dentry *parent, struct qstr *d_name, struct qstr *name)
#endif
{
-#ifdef HAVE_D_COMPARE_7ARGS
+#if !defined(HAVE_D_COMPARE_7ARGS) && !defined(HAVE_D_COMPARE_5ARGS)
+ /* 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;
+ const char *str = d_name->name;
+#endif
ENTRY;
if (len != name->len)
if (memcmp(str, name->name, len))
RETURN(1);
-#else
- struct dentry *dentry;
- ENTRY;
-
- if (d_name->len != name->len)
- RETURN(1);
-
- if (memcmp(d_name->name, name->name, name->len))
- RETURN(1);
-
- /* XXX: d_name must be in-dentry structure */
- dentry = container_of(d_name, struct dentry, d_name); /* ugh */
-#endif
CDEBUG(D_DENTRY, "found name %.*s(%p) flags %#x refc %d\n",
name->len, name->name, dentry, dentry->d_flags,
RETURN(0);
if (d_lustre_invalid(dentry))
- RETURN(1);
+ RETURN(1);
- RETURN(0);
+ RETURN(0);
}
static inline int return_if_equal(struct ldlm_lock *lock, void *data)
void ll_invalidate_aliases(struct inode *);
void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft);
void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry);
-#ifdef HAVE_D_COMPARE_7ARGS
-int ll_dcompare(const struct dentry *parent, const struct inode *pinode,
- const struct dentry *dentry, const struct inode *inode,
- unsigned int len, const char *str, const struct qstr *d_name);
-#else
-int ll_dcompare(struct dentry *parent, struct qstr *d_name, struct qstr *name);
-#endif
int ll_revalidate_it_finish(struct ptlrpc_request *request,
struct lookup_intent *it, struct dentry *de);