mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
switch posix_acl_create() to umode_t *
so we can pass &inode->i_mode to it Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
782b94cdf5
commit
d3fb612076
@ -182,11 +182,11 @@ int v9fs_set_create_acl(struct dentry *dentry,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int v9fs_acl_mode(struct inode *dir, mode_t *modep,
|
||||
int v9fs_acl_mode(struct inode *dir, umode_t *modep,
|
||||
struct posix_acl **dpacl, struct posix_acl **pacl)
|
||||
{
|
||||
int retval = 0;
|
||||
mode_t mode = *modep;
|
||||
umode_t mode = *modep;
|
||||
struct posix_acl *acl = NULL;
|
||||
|
||||
if (!S_ISLNK(mode)) {
|
||||
|
@ -20,7 +20,7 @@ extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type);
|
||||
extern int v9fs_acl_chmod(struct dentry *);
|
||||
extern int v9fs_set_create_acl(struct dentry *,
|
||||
struct posix_acl **, struct posix_acl **);
|
||||
extern int v9fs_acl_mode(struct inode *dir, mode_t *modep,
|
||||
extern int v9fs_acl_mode(struct inode *dir, umode_t *modep,
|
||||
struct posix_acl **dpacl, struct posix_acl **pacl);
|
||||
#else
|
||||
#define v9fs_iop_get_acl NULL
|
||||
@ -38,7 +38,7 @@ static inline int v9fs_set_create_acl(struct dentry *dentry,
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int v9fs_acl_mode(struct inode *dir, mode_t *modep,
|
||||
static inline int v9fs_acl_mode(struct inode *dir, umode_t *modep,
|
||||
struct posix_acl **dpacl,
|
||||
struct posix_acl **pacl)
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
|
||||
int err = 0;
|
||||
gid_t gid;
|
||||
int flags;
|
||||
mode_t mode;
|
||||
umode_t mode;
|
||||
char *name = NULL;
|
||||
struct file *filp;
|
||||
struct p9_qid qid;
|
||||
@ -348,7 +348,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
|
||||
struct p9_fid *fid = NULL, *dfid = NULL;
|
||||
gid_t gid;
|
||||
char *name;
|
||||
mode_t mode;
|
||||
umode_t mode;
|
||||
struct inode *inode;
|
||||
struct p9_qid qid;
|
||||
struct dentry *dir_dentry;
|
||||
@ -751,7 +751,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
|
||||
int err;
|
||||
gid_t gid;
|
||||
char *name;
|
||||
mode_t mode;
|
||||
umode_t mode;
|
||||
struct v9fs_session_info *v9ses;
|
||||
struct p9_fid *fid = NULL, *dfid = NULL;
|
||||
struct inode *inode;
|
||||
|
@ -222,19 +222,16 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans,
|
||||
}
|
||||
|
||||
if (IS_POSIXACL(dir) && acl) {
|
||||
mode_t mode = inode->i_mode;
|
||||
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
ret = btrfs_set_acl(trans, inode, acl,
|
||||
ACL_TYPE_DEFAULT);
|
||||
if (ret)
|
||||
goto failed;
|
||||
}
|
||||
ret = posix_acl_create(&acl, GFP_NOFS, &mode);
|
||||
ret = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
inode->i_mode = mode;
|
||||
if (ret > 0) {
|
||||
/* we need an acl */
|
||||
ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS);
|
||||
|
@ -253,16 +253,14 @@ ext2_init_acl(struct inode *inode, struct inode *dir)
|
||||
inode->i_mode &= ~current_umask();
|
||||
}
|
||||
if (test_opt(inode->i_sb, POSIX_ACL) && acl) {
|
||||
mode_t mode = inode->i_mode;
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
error = ext2_set_acl(inode, ACL_TYPE_DEFAULT, acl);
|
||||
if (error)
|
||||
goto cleanup;
|
||||
}
|
||||
error = posix_acl_create(&acl, GFP_KERNEL, &mode);
|
||||
error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode);
|
||||
if (error < 0)
|
||||
return error;
|
||||
inode->i_mode = mode;
|
||||
if (error > 0) {
|
||||
/* This is an extended ACL */
|
||||
error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl);
|
||||
|
@ -261,19 +261,16 @@ ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
|
||||
inode->i_mode &= ~current_umask();
|
||||
}
|
||||
if (test_opt(inode->i_sb, POSIX_ACL) && acl) {
|
||||
mode_t mode = inode->i_mode;
|
||||
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
error = ext3_set_acl(handle, inode,
|
||||
ACL_TYPE_DEFAULT, acl);
|
||||
if (error)
|
||||
goto cleanup;
|
||||
}
|
||||
error = posix_acl_create(&acl, GFP_NOFS, &mode);
|
||||
error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
inode->i_mode = mode;
|
||||
if (error > 0) {
|
||||
/* This is an extended ACL */
|
||||
error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl);
|
||||
|
@ -259,19 +259,16 @@ ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
|
||||
inode->i_mode &= ~current_umask();
|
||||
}
|
||||
if (test_opt(inode->i_sb, POSIX_ACL) && acl) {
|
||||
mode_t mode = inode->i_mode;
|
||||
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
error = ext4_set_acl(handle, inode,
|
||||
ACL_TYPE_DEFAULT, acl);
|
||||
if (error)
|
||||
goto cleanup;
|
||||
}
|
||||
error = posix_acl_create(&acl, GFP_NOFS, &mode);
|
||||
error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode);
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
inode->i_mode = mode;
|
||||
if (error > 0) {
|
||||
/* This is an extended ACL */
|
||||
error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl);
|
||||
|
@ -125,21 +125,20 @@ int
|
||||
generic_acl_init(struct inode *inode, struct inode *dir)
|
||||
{
|
||||
struct posix_acl *acl = NULL;
|
||||
mode_t mode = inode->i_mode;
|
||||
int error;
|
||||
|
||||
inode->i_mode = mode & ~current_umask();
|
||||
if (!S_ISLNK(inode->i_mode))
|
||||
acl = get_cached_acl(dir, ACL_TYPE_DEFAULT);
|
||||
if (acl) {
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
set_cached_acl(inode, ACL_TYPE_DEFAULT, acl);
|
||||
error = posix_acl_create(&acl, GFP_KERNEL, &mode);
|
||||
error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode);
|
||||
if (error < 0)
|
||||
return error;
|
||||
inode->i_mode = mode;
|
||||
if (error > 0)
|
||||
set_cached_acl(inode, ACL_TYPE_ACCESS, acl);
|
||||
} else {
|
||||
inode->i_mode &= ~current_umask();
|
||||
}
|
||||
error = 0;
|
||||
|
||||
|
@ -72,7 +72,7 @@ struct posix_acl *gfs2_get_acl(struct inode *inode, int type)
|
||||
return gfs2_acl_get(GFS2_I(inode), type);
|
||||
}
|
||||
|
||||
static int gfs2_set_mode(struct inode *inode, mode_t mode)
|
||||
static int gfs2_set_mode(struct inode *inode, umode_t mode)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
@ -117,7 +117,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode)
|
||||
{
|
||||
struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
|
||||
struct posix_acl *acl;
|
||||
mode_t mode = inode->i_mode;
|
||||
umode_t mode = inode->i_mode;
|
||||
int error = 0;
|
||||
|
||||
if (!sdp->sd_args.ar_posix_acl)
|
||||
|
@ -259,7 +259,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
|
||||
return rc;
|
||||
}
|
||||
|
||||
int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode)
|
||||
int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, umode_t *i_mode)
|
||||
{
|
||||
struct posix_acl *acl;
|
||||
int rc;
|
||||
|
@ -28,7 +28,7 @@ struct jffs2_acl_header {
|
||||
|
||||
struct posix_acl *jffs2_get_acl(struct inode *inode, int type);
|
||||
extern int jffs2_acl_chmod(struct inode *);
|
||||
extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *);
|
||||
extern int jffs2_init_acl_pre(struct inode *, struct inode *, umode_t *);
|
||||
extern int jffs2_init_acl_post(struct inode *);
|
||||
|
||||
extern const struct xattr_handler jffs2_acl_access_xattr_handler;
|
||||
|
@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
|
||||
|
||||
/* jffs2_new_inode: allocate a new inode and inocache, add it to the hash,
|
||||
fill in the raw_inode while you're at it. */
|
||||
struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri)
|
||||
struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_raw_inode *ri)
|
||||
{
|
||||
struct inode *inode;
|
||||
struct super_block *sb = dir_i->i_sb;
|
||||
|
@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *);
|
||||
struct inode *jffs2_iget(struct super_block *, unsigned long);
|
||||
void jffs2_evict_inode (struct inode *);
|
||||
void jffs2_dirty_inode(struct inode *inode, int flags);
|
||||
struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode,
|
||||
struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode,
|
||||
struct jffs2_raw_inode *ri);
|
||||
int jffs2_statfs (struct dentry *, struct kstatfs *);
|
||||
int jffs2_remount_fs (struct super_block *, int *, char *);
|
||||
|
@ -127,16 +127,14 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir)
|
||||
return PTR_ERR(acl);
|
||||
|
||||
if (acl) {
|
||||
mode_t mode = inode->i_mode;
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl);
|
||||
if (rc)
|
||||
goto cleanup;
|
||||
}
|
||||
rc = posix_acl_create(&acl, GFP_KERNEL, &mode);
|
||||
rc = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode);
|
||||
if (rc < 0)
|
||||
goto cleanup; /* posix_acl_release(NULL) is no-op */
|
||||
inode->i_mode = mode;
|
||||
if (rc > 0)
|
||||
rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl);
|
||||
cleanup:
|
||||
|
@ -415,7 +415,7 @@ int nfs3_proc_setacl(struct inode *inode, int type, struct posix_acl *acl)
|
||||
}
|
||||
|
||||
int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
|
||||
mode_t mode)
|
||||
umode_t mode)
|
||||
{
|
||||
struct posix_acl *dfacl, *acl;
|
||||
int error = 0;
|
||||
|
@ -316,7 +316,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
|
||||
int flags, struct nfs_open_context *ctx)
|
||||
{
|
||||
struct nfs3_createdata *data;
|
||||
mode_t mode = sattr->ia_mode;
|
||||
umode_t mode = sattr->ia_mode;
|
||||
int status = -ENOMEM;
|
||||
|
||||
dprintk("NFS call create %s\n", dentry->d_name.name);
|
||||
@ -562,7 +562,7 @@ static int
|
||||
nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
|
||||
{
|
||||
struct nfs3_createdata *data;
|
||||
int mode = sattr->ia_mode;
|
||||
umode_t mode = sattr->ia_mode;
|
||||
int status = -ENOMEM;
|
||||
|
||||
dprintk("NFS call mkdir %s\n", dentry->d_name.name);
|
||||
@ -681,7 +681,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
|
||||
dev_t rdev)
|
||||
{
|
||||
struct nfs3_createdata *data;
|
||||
mode_t mode = sattr->ia_mode;
|
||||
umode_t mode = sattr->ia_mode;
|
||||
int status = -ENOMEM;
|
||||
|
||||
dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name,
|
||||
|
@ -351,7 +351,7 @@ int ocfs2_init_acl(handle_t *handle,
|
||||
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||
struct posix_acl *acl = NULL;
|
||||
int ret = 0, ret2;
|
||||
mode_t mode;
|
||||
umode_t mode;
|
||||
|
||||
if (!S_ISLNK(inode->i_mode)) {
|
||||
if (osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) {
|
||||
|
@ -279,11 +279,11 @@ posix_acl_permission(struct inode *inode, const struct posix_acl *acl, int want)
|
||||
* system calls. All permissions that are not granted by the acl are removed.
|
||||
* The permissions in the acl are changed to reflect the mode_p parameter.
|
||||
*/
|
||||
static int posix_acl_create_masq(struct posix_acl *acl, mode_t *mode_p)
|
||||
static int posix_acl_create_masq(struct posix_acl *acl, umode_t *mode_p)
|
||||
{
|
||||
struct posix_acl_entry *pa, *pe;
|
||||
struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL;
|
||||
mode_t mode = *mode_p;
|
||||
umode_t mode = *mode_p;
|
||||
int not_equiv = 0;
|
||||
|
||||
/* assert(atomic_read(acl->a_refcount) == 1); */
|
||||
@ -382,7 +382,7 @@ static int posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode)
|
||||
}
|
||||
|
||||
int
|
||||
posix_acl_create(struct posix_acl **acl, gfp_t gfp, mode_t *mode_p)
|
||||
posix_acl_create(struct posix_acl **acl, gfp_t gfp, umode_t *mode_p)
|
||||
{
|
||||
struct posix_acl *clone = posix_acl_clone(*acl, gfp);
|
||||
int err = -ENOMEM;
|
||||
|
@ -354,8 +354,6 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
|
||||
return PTR_ERR(acl);
|
||||
|
||||
if (acl) {
|
||||
mode_t mode = inode->i_mode;
|
||||
|
||||
/* Copy the default ACL to the default ACL of a new directory */
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
err = reiserfs_set_acl(th, inode, ACL_TYPE_DEFAULT,
|
||||
@ -366,12 +364,10 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
|
||||
|
||||
/* Now we reconcile the new ACL and the mode,
|
||||
potentially modifying both */
|
||||
err = posix_acl_create(&acl, GFP_NOFS, &mode);
|
||||
err = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
inode->i_mode = mode;
|
||||
|
||||
/* If we need an ACL.. */
|
||||
if (err > 0)
|
||||
err = reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS, acl);
|
||||
|
@ -221,7 +221,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
|
||||
}
|
||||
|
||||
static int
|
||||
xfs_set_mode(struct inode *inode, mode_t mode)
|
||||
xfs_set_mode(struct inode *inode, umode_t mode)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
@ -267,7 +267,7 @@ posix_acl_default_exists(struct inode *inode)
|
||||
int
|
||||
xfs_inherit_acl(struct inode *inode, struct posix_acl *acl)
|
||||
{
|
||||
mode_t mode = inode->i_mode;
|
||||
umode_t mode = inode->i_mode;
|
||||
int error = 0, inherit = 0;
|
||||
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
|
@ -568,12 +568,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type);
|
||||
extern int nfs3_proc_setacl(struct inode *inode, int type,
|
||||
struct posix_acl *acl);
|
||||
extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
|
||||
mode_t mode);
|
||||
umode_t mode);
|
||||
extern void nfs3_forget_cached_acls(struct inode *inode);
|
||||
#else
|
||||
static inline int nfs3_proc_set_default_acl(struct inode *dir,
|
||||
struct inode *inode,
|
||||
mode_t mode)
|
||||
umode_t mode)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ extern int posix_acl_valid(const struct posix_acl *);
|
||||
extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
|
||||
extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t);
|
||||
extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *);
|
||||
extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *);
|
||||
extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
|
||||
extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t);
|
||||
|
||||
extern struct posix_acl *get_posix_acl(struct inode *, int);
|
||||
|
Loading…
Reference in New Issue
Block a user