Linux 3.6: create inode operation API change
authorMarc Dionne <marc.c.dionne@gmail.com>
Tue, 14 Aug 2012 21:28:50 +0000 (17:28 -0400)
committerDerrick Brashear <shadow@dementix.org>
Fri, 17 Aug 2012 18:14:54 +0000 (11:14 -0700)
The nameidata argument is dropped and a flag is added.

Change-Id: I33692fc506e7eb9b8935a27ff3d10b713dfa6e5e
Reviewed-on: http://gerrit.openafs.org/7985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4

index 7a76b8b..f83569d 100644 (file)
@@ -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
index 382dcec..3ce0170 100644 (file)
@@ -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();
index 75561bf..ae1a741 100644 (file)
@@ -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 <linux/fs.h>
+                       #include <linux/namei.h>],
+                       [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])
+])