From 020e32779c103817ca89caa51259fb53bc3dde79 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 14 Aug 2012 17:28:50 -0400 Subject: [PATCH] Linux 3.6: create inode operation API change The nameidata argument is dropped and a flag is added. Change-Id: I33692fc506e7eb9b8935a27ff3d10b713dfa6e5e Reviewed-on: http://gerrit.openafs.org/7985 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- acinclude.m4 | 1 + src/afs/LINUX/osi_vnodeops.c | 9 +++++---- src/cf/linux-test4.m4 | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 7a76b8b..f83569d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -978,6 +978,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE LINUX_DENTRY_OPEN_TAKES_PATH LINUX_D_ALIAS_IS_HLIST + LINUX_IOP_I_CREATE_TAKES_BOOL 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 382dcec..3ce0170 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1279,17 +1279,18 @@ struct dentry_operations afs_dentry_operations = { * name is in kernel space at this point. */ static int -#if defined(IOP_CREATE_TAKES_UMODE_T) +#if defined(IOP_CREATE_TAKES_BOOL) +afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode, + bool excl) +#elif defined(IOP_CREATE_TAKES_UMODE_T) afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode, struct nameidata *nd) -#else -#ifdef IOP_CREATE_TAKES_NAMEIDATA +#elif defined(IOP_CREATE_TAKES_NAMEIDATA) afs_linux_create(struct inode *dip, struct dentry *dp, int mode, struct nameidata *nd) #else afs_linux_create(struct inode *dip, struct dentry *dp, int mode) #endif -#endif { struct vattr vattr; cred_t *credp = crref(); diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 75561bf..ae1a741 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -702,3 +702,18 @@ AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [ [define if dentry->d_alias is an hlist], []) ]) + + +AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_BOOL], [ + AC_CHECK_LINUX_BUILD([whether inode_operations.create takes a bool], + [ac_cv_linux_func_i_create_takes_bool], + [#include + #include ], + [struct inode _inode = {}; + struct dentry _dentry; + bool b = true; + (void)_inode.i_op->create(&_inode, &_dentry, 0, b);], + [IOP_CREATE_TAKES_BOOL], + [define if your iops.create takes a bool argument], + [-Werror]) +]) -- 1.9.4