From ec48dca871ef98adb69792a34047c6be5818f1b2 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 14 Aug 2012 18:26:24 -0400 Subject: [PATCH] Linux 3.6: lookup inode operation API change The nameidata argument is replaced with an unsigned int flags argument. Change-Id: Ife07bb50ae7d747bd6256ea8238c4e19dbb5ee3f Reviewed-on: http://gerrit.openafs.org/7987 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- acinclude.m4 | 1 + src/afs/LINUX/osi_vnodeops.c | 5 ++++- src/cf/linux-test4.m4 | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 0483c7cb3..2e9cf6b0f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -980,6 +980,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_D_ALIAS_IS_HLIST LINUX_IOP_I_CREATE_TAKES_BOOL LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED + LINUX_IOP_LOOKUP_TAKES_UNSIGNED dnl If we are guaranteed that keyrings will work - that is dnl a) The kernel has keyrings enabled diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index e36475d51..36cd056c7 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1332,7 +1332,10 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode) /* afs_linux_lookup */ static struct dentry * -#ifdef IOP_LOOKUP_TAKES_NAMEIDATA +#if defined(IOP_LOOKUP_TAKES_UNSIGNED) +afs_linux_lookup(struct inode *dip, struct dentry *dp, + unsigned flags) +#elif defined(IOP_LOOKUP_TAKES_NAMEIDATA) afs_linux_lookup(struct inode *dip, struct dentry *dp, struct nameidata *nd) #else diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index a99becbf0..ad319d0e9 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -731,3 +731,17 @@ AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED], [ [define if your dops.d_revalidate takes an unsigned int argument], [-Werror]) ]) + + +AC_DEFUN([LINUX_IOP_LOOKUP_TAKES_UNSIGNED], [ + AC_CHECK_LINUX_BUILD([whether inode operation lookup takes an unsigned int], + [ac_cv_linux_func_lookup_takes_unsigned], + [#include + #include ], + [struct inode_operations iops; + struct dentry *look(struct inode *i, struct dentry *d, unsigned int j) { return NULL; }; + iops.lookup = look;], + [IOP_LOOKUP_TAKES_UNSIGNED], + [define if your iops.lookup takes an unsigned int argument], + [-Werror]) +]) -- 2.39.5