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>
Mon, 26 Mar 2012 01:38:13 +0000 (18:38 -0700)
The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

Reviewed-on: http://gerrit.openafs.org/6567
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit beafc7f742ebad021bfcbed73884aecedee4e04b)

Change-Id: Ib12c319b55810192c3181f4f2ec340b94a32cb6f
Reviewed-on: http://gerrit.openafs.org/6944
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

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

index 45f06cb..6e2c9ae 100644 (file)
@@ -953,6 +953,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 e8fc96a..4cda547 100644 (file)
@@ -1094,12 +1094,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();
@@ -1327,7 +1332,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 d99fead..f5e91b1 100644 (file)
@@ -634,3 +634,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])
+])