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 <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit beafc7f742)

Change-Id: Ib12c319b55810192c3181f4f2ec340b94a32cb6f
Reviewed-on: http://gerrit.openafs.org/6944
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Marc Dionne 2012-01-18 11:22:35 -05:00 committed by Derrick Brashear
parent f565ed2e32
commit 2060ab9835
3 changed files with 38 additions and 0 deletions

View 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

View 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();

View 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])
])