kill boilerplate around posix_acl_chmod_masq()
[pandora-kernel.git] / fs / gfs2 / acl.c
index 4d97352..160d4e1 100644 (file)
@@ -75,17 +75,11 @@ static struct posix_acl *gfs2_acl_get(struct gfs2_inode *ip, int type)
  * Returns: errno
  */
 
-int gfs2_check_acl(struct inode *inode, int mask, unsigned int flags)
+int gfs2_check_acl(struct inode *inode, int mask)
 {
        struct posix_acl *acl;
        int error;
 
-       if (mask & MAY_NOT_BLOCK) {
-               if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
-                       return -ECHILD;
-               return -EAGAIN;
-       }
-
        acl = gfs2_acl_get(GFS2_I(inode), ACL_TYPE_ACCESS);
        if (IS_ERR(acl))
                return PTR_ERR(acl);
@@ -193,7 +187,7 @@ out:
 
 int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
 {
-       struct posix_acl *acl, *clone;
+       struct posix_acl *acl;
        char *data;
        unsigned int len;
        int error;
@@ -204,25 +198,19 @@ int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
        if (!acl)
                return gfs2_setattr_simple(ip, attr);
 
-       clone = posix_acl_clone(acl, GFP_NOFS);
+       error = posix_acl_chmod(&acl, GFP_NOFS, attr->ia_mode);
+       if (error)
+               return error;
+
+       len = posix_acl_to_xattr(acl, NULL, 0);
+       data = kmalloc(len, GFP_NOFS);
        error = -ENOMEM;
-       if (!clone)
+       if (data == NULL)
                goto out;
-       posix_acl_release(acl);
-       acl = clone;
-
-       error = posix_acl_chmod_masq(acl, attr->ia_mode);
-       if (!error) {
-               len = posix_acl_to_xattr(acl, NULL, 0);
-               data = kmalloc(len, GFP_NOFS);
-               error = -ENOMEM;
-               if (data == NULL)
-                       goto out;
-               posix_acl_to_xattr(acl, data, len);
-               error = gfs2_xattr_acl_chmod(ip, attr, data);
-               kfree(data);
-               set_cached_acl(&ip->i_inode, ACL_TYPE_ACCESS, acl);
-       }
+       posix_acl_to_xattr(acl, data, len);
+       error = gfs2_xattr_acl_chmod(ip, attr, data);
+       kfree(data);
+       set_cached_acl(&ip->i_inode, ACL_TYPE_ACCESS, acl);
 
 out:
        posix_acl_release(acl);