From: Marc Dionne Date: Wed, 18 Jan 2012 16:22:35 +0000 (-0500) Subject: Linux 3.3: use umode_t for mkdir and create inode ops X-Git-Tag: upstream/1.6.1^2~4 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2060ab9835d7707f52a64066946a5217b6c35c81;p=packages%2Fo%2Fopenafs.git Linux 3.3: use umode_t for mkdir and create inode ops 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 Tested-by: BuildBot (cherry picked from commit beafc7f742ebad021bfcbed73884aecedee4e04b) Change-Id: Ib12c319b55810192c3181f4f2ec340b94a32cb6f Reviewed-on: http://gerrit.openafs.org/6944 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index 45f06cbd9..6e2c9ae85 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index e8fc96a9b..4cda54793 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -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(); diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index d99feadf3..f5e91b158 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 ], + [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 ], + [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]) +])