Linux 3.3: use umode_t for mkdir and create inode ops
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 18 Jan 2012 16:22:35 +0000 (11:22 -0500)
committerDerrick Brashear <shadow@dementix.org>
Wed, 18 Jan 2012 18:12:40 +0000 (10:12 -0800)
The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

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

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

index 8f6ccf1..d9e6a35 100644 (file)
@@ -950,6 +950,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
                 LINUX_HAVE_DCACHE_LOCK
                 LINUX_D_COUNT_IS_INT
+                LINUX_IOP_MKDIR_TAKES_UMODE_T
+                LINUX_IOP_CREATE_TAKES_UMODE_T
 
                 dnl If we are guaranteed that keyrings will work - that is
                 dnl  a) The kernel has keyrings enabled
index c379f67..ae17006 100644 (file)
@@ -1097,12 +1097,17 @@ struct dentry_operations afs_dentry_operations = {
  * name is in kernel space at this point.
  */
 static int
+#if defined(IOP_MKDIR_TAKES_UMODE_T)
+afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode,
+                struct nameidata *nd)
+#else
 #ifdef 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();
@@ -1330,7 +1335,11 @@ afs_linux_symlink(struct inode *dip, struct dentry *dp, const char *target)
 }
 
 static int
+#if defined(IOP_MKDIR_TAKES_UMODE_T)
+afs_linux_mkdir(struct inode *dip, struct dentry *dp, umode_t mode)
+#else
 afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode)
+#endif
 {
     int code;
     cred_t *credp = crref();
index b7c9070..7ff0a5c 100644 (file)
@@ -624,3 +624,30 @@ AC_DEFUN([LINUX_DOP_D_DELETE_TAKES_CONST], [
                        [define if dentry.d_op->d_delete takes a const argument],
                        [-Werror])
 ])
+
+
+AC_DEFUN([LINUX_IOP_MKDIR_TAKES_UMODE_T], [
+  AC_CHECK_LINUX_BUILD([whether inode.i_op->mkdir takes a umode_t argument],
+                       [ac_cv_linux_iop_mkdir_takes_umode_t],
+                       [#include <linux/fs.h>],
+                       [struct inode_operations _i_ops;
+                       int _mkdir(struct inode *i, struct dentry *d, umode_t m) {return 0;};
+                       _i_ops.mkdir = _mkdir;],
+                       [IOP_MKDIR_TAKES_UMODE_T],
+                       [define if inode.i_op->mkdir takes a umode_t argument],
+                       [-Werror])
+])
+
+
+AC_DEFUN([LINUX_IOP_CREATE_TAKES_UMODE_T], [
+  AC_CHECK_LINUX_BUILD([whether inode.i_op->create takes a umode_t argument],
+                       [ac_cv_linux_iop_create_takes_umode_t],
+                       [#include <linux/fs.h>],
+                       [struct inode_operations _i_ops;
+                       int _create(struct inode *i, struct dentry *d, umode_t m, struct nameidata *n)
+                               {return 0;};
+                       _i_ops.create = _create;],
+                       [IOP_CREATE_TAKES_UMODE_T],
+                       [define if inode.i_op->create takes a umode_t argument],
+                       [-Werror])
+])