switch posix_acl_equiv_mode() to umode_t *
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 23 Jul 2011 22:56:36 +0000 (18:56 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 1 Aug 2011 06:10:06 +0000 (02:10 -0400)
... so that &inode->i_mode could be passed to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
14 files changed:
fs/9p/acl.c
fs/btrfs/acl.c
fs/ext2/acl.c
fs/ext3/acl.c
fs/ext4/acl.c
fs/generic_acl.c
fs/gfs2/acl.c
fs/jffs2/acl.c
fs/jfs/xattr.c
fs/ocfs2/acl.c
fs/posix_acl.c
fs/reiserfs/xattr_acl.c
fs/xfs/linux-2.6/xfs_acl.c
include/linux/posix_acl.h

index ad734e3220cf5e7089b43b7ba8ed3e05ce2a5296..9a1d426307510135444da722883e570fe52410b9 100644 (file)
@@ -319,7 +319,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,
        case ACL_TYPE_ACCESS:
                name = POSIX_ACL_XATTR_ACCESS;
                if (acl) {
-                       mode_t mode = inode->i_mode;
+                       umode_t mode = inode->i_mode;
                        retval = posix_acl_equiv_mode(acl, &mode);
                        if (retval < 0)
                                goto err_out;
index 59086142c14d7427d1c8240bbd55eea7ada06033..4cc5c0164ed650224655704d3b9eea48832a1cfd 100644 (file)
@@ -111,7 +111,6 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans,
        int ret, size = 0;
        const char *name;
        char *value = NULL;
-       mode_t mode;
 
        if (acl) {
                ret = posix_acl_valid(acl);
@@ -122,13 +121,11 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans,
 
        switch (type) {
        case ACL_TYPE_ACCESS:
-               mode = inode->i_mode;
                name = POSIX_ACL_XATTR_ACCESS;
                if (acl) {
-                       ret = posix_acl_equiv_mode(acl, &mode);
+                       ret = posix_acl_equiv_mode(acl, &inode->i_mode);
                        if (ret < 0)
                                return ret;
-                       inode->i_mode = mode;
                }
                ret = 0;
                break;
index 0ce740489ab140c88eeba18471afc9bdb08d2310..35d6a3cfd9ff3a5c6562adb46fc614595ff4c718 100644 (file)
@@ -194,12 +194,10 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
                case ACL_TYPE_ACCESS:
                        name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
                        if (acl) {
-                               mode_t mode = inode->i_mode;
-                               error = posix_acl_equiv_mode(acl, &mode);
+                               error = posix_acl_equiv_mode(acl, &inode->i_mode);
                                if (error < 0)
                                        return error;
                                else {
-                                       inode->i_mode = mode;
                                        inode->i_ctime = CURRENT_TIME_SEC;
                                        mark_inode_dirty(inode);
                                        if (error == 0)
index 74a3c6486f8fc3817271f3fe4724ae6ad3f84db1..3091f62e55b680ae567817c50a6bda3161753895 100644 (file)
@@ -199,12 +199,10 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type,
                case ACL_TYPE_ACCESS:
                        name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS;
                        if (acl) {
-                               mode_t mode = inode->i_mode;
-                               error = posix_acl_equiv_mode(acl, &mode);
+                               error = posix_acl_equiv_mode(acl, &inode->i_mode);
                                if (error < 0)
                                        return error;
                                else {
-                                       inode->i_mode = mode;
                                        inode->i_ctime = CURRENT_TIME_SEC;
                                        ext3_mark_inode_dirty(handle, inode);
                                        if (error == 0)
index 74e469ccdf50ca18ed797bf80f2fbd464e118973..a5c29bb3b835d7c528d0b9f65ce3436e8b7f9181 100644 (file)
@@ -198,12 +198,10 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
        case ACL_TYPE_ACCESS:
                name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
                if (acl) {
-                       mode_t mode = inode->i_mode;
-                       error = posix_acl_equiv_mode(acl, &mode);
+                       error = posix_acl_equiv_mode(acl, &inode->i_mode);
                        if (error < 0)
                                return error;
                        else {
-                               inode->i_mode = mode;
                                inode->i_ctime = ext4_current_time(inode);
                                ext4_mark_inode_dirty(handle, inode);
                                if (error == 0)
index 2dd434d6ff29dc4cb224b200e2847132fc970d22..d0dddaceac594888c96388b5ed82f7ab33bc9846 100644 (file)
@@ -82,18 +82,14 @@ generic_acl_set(struct dentry *dentry, const char *name, const void *value,
                        return PTR_ERR(acl);
        }
        if (acl) {
-               mode_t mode;
-
                error = posix_acl_valid(acl);
                if (error)
                        goto failed;
                switch (type) {
                case ACL_TYPE_ACCESS:
-                       mode = inode->i_mode;
-                       error = posix_acl_equiv_mode(acl, &mode);
+                       error = posix_acl_equiv_mode(acl, &inode->i_mode);
                        if (error < 0)
                                goto failed;
-                       inode->i_mode = mode;
                        inode->i_ctime = CURRENT_TIME;
                        if (error == 0) {
                                posix_acl_release(acl);
index 0ac3c53f928fc8216ce3eaabc9cd6d10beb91d36..34501b64bc47a416993677b641b30fe64a84d13c 100644 (file)
@@ -276,7 +276,7 @@ static int gfs2_xattr_system_set(struct dentry *dentry, const char *name,
                goto out_release;
 
        if (type == ACL_TYPE_ACCESS) {
-               mode_t mode = inode->i_mode;
+               umode_t mode = inode->i_mode;
                error = posix_acl_equiv_mode(acl, &mode);
 
                if (error <= 0) {
index 6372a84728d70c3ab02515d7be9b1f6acc7251df..926d02068a142c6ac4b5ac4cb7f02fec0b666937 100644 (file)
@@ -227,7 +227,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
        case ACL_TYPE_ACCESS:
                xprefix = JFFS2_XPREFIX_ACL_ACCESS;
                if (acl) {
-                       mode_t mode = inode->i_mode;
+                       umode_t mode = inode->i_mode;
                        rc = posix_acl_equiv_mode(acl, &mode);
                        if (rc < 0)
                                return rc;
index 24838f1eeee5c0f5093d96fef01c80d1835991ea..e87fedef23db7938aa7b38f64f385b0615e193b4 100644 (file)
@@ -693,8 +693,7 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
                        return rc;
                }
                if (acl) {
-                       mode_t mode = inode->i_mode;
-                       rc = posix_acl_equiv_mode(acl, &mode);
+                       rc = posix_acl_equiv_mode(acl, &inode->i_mode);
                        posix_acl_release(acl);
                        if (rc < 0) {
                                printk(KERN_ERR
@@ -702,7 +701,6 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
                                       rc);
                                return rc;
                        }
-                       inode->i_mode = mode;
                        mark_inode_dirty(inode);
                }
                /*
index fbafc6e36e251a9409d3d349b462fbd6141cabd6..a7219075b4deddcd7881a9b3a5c1586f731d36f2 100644 (file)
@@ -247,7 +247,7 @@ static int ocfs2_set_acl(handle_t *handle,
        case ACL_TYPE_ACCESS:
                name_index = OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS;
                if (acl) {
-                       mode_t mode = inode->i_mode;
+                       umode_t mode = inode->i_mode;
                        ret = posix_acl_equiv_mode(acl, &mode);
                        if (ret < 0)
                                return ret;
index f0a017edee1e365316176844e96e495f66ff54d6..3d943be6761c9ffd27c3f732345307da01d604d6 100644 (file)
@@ -149,10 +149,10 @@ posix_acl_valid(const struct posix_acl *acl)
  * file mode permission bits, or else 1. Returns -E... on error.
  */
 int
-posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p)
+posix_acl_equiv_mode(const struct posix_acl *acl, umode_t *mode_p)
 {
        const struct posix_acl_entry *pa, *pe;
-       mode_t mode = 0;
+       umode_t mode = 0;
        int not_equiv = 0;
 
        FOREACH_ACL_ENTRY(pa, acl, pe) {
index 89ebc77e0e9a17b74272fa22b6359b8d01f41e8e..6da0396e50528b2ac676c3a8d0aef72d3231ff16 100644 (file)
@@ -272,12 +272,10 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
        case ACL_TYPE_ACCESS:
                name = POSIX_ACL_XATTR_ACCESS;
                if (acl) {
-                       mode_t mode = inode->i_mode;
-                       error = posix_acl_equiv_mode(acl, &mode);
+                       error = posix_acl_equiv_mode(acl, &inode->i_mode);
                        if (error < 0)
                                return error;
                        else {
-                               inode->i_mode = mode;
                                if (error == 0)
                                        acl = NULL;
                        }
index bb85500e0b888a6a7e0417d7d54b0ea40c90a810..b6c4b3795c4a000ce27ac3799b5c39ae6c8044e9 100644 (file)
@@ -381,7 +381,7 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,
                goto out_release;
 
        if (type == ACL_TYPE_ACCESS) {
-               mode_t mode = inode->i_mode;
+               umode_t mode = inode->i_mode;
                error = posix_acl_equiv_mode(acl, &mode);
 
                if (error <= 0) {
index bd8d0050d725e08ff11f38b07452becca398fd58..529c32ad58c0b0c5ddfdecf794f86aa37089ffd1 100644 (file)
@@ -76,7 +76,7 @@ extern struct posix_acl *posix_acl_alloc(int, gfp_t);
 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_equiv_mode(const struct posix_acl *, umode_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);