]> Pileus Git - ~andy/linux/blobdiff - fs/jfs/acl.c
Merge branch 'fix/kconfig' into for-linus
[~andy/linux] / fs / jfs / acl.c
index 89ced71e225af11007107f04f9f184237f60ab41..45559dc3ea2f59297f57c523a8eac2b3f40c06c6 100644 (file)
@@ -27,7 +27,7 @@
 #include "jfs_xattr.h"
 #include "jfs_acl.h"
 
-static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
+struct posix_acl *jfs_get_acl(struct inode *inode, int type)
 {
        struct posix_acl *acl;
        char *ea_name;
@@ -114,27 +114,9 @@ out:
        return rc;
 }
 
-int jfs_check_acl(struct inode *inode, int mask)
-{
-       struct posix_acl *acl;
-
-       acl = jfs_get_acl(inode, ACL_TYPE_ACCESS);
-       if (IS_ERR(acl))
-               return PTR_ERR(acl);
-       if (acl) {
-               int error = posix_acl_permission(inode, acl, mask);
-               posix_acl_release(acl);
-               return error;
-       }
-
-       return -EAGAIN;
-}
-
 int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir)
 {
        struct posix_acl *acl = NULL;
-       struct posix_acl *clone;
-       mode_t mode;
        int rc = 0;
 
        if (S_ISLNK(inode->i_mode))
@@ -150,20 +132,11 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir)
                        if (rc)
                                goto cleanup;
                }
-               clone = posix_acl_clone(acl, GFP_KERNEL);
-               if (!clone) {
-                       rc = -ENOMEM;
-                       goto cleanup;
-               }
-               mode = inode->i_mode;
-               rc = posix_acl_create_masq(clone, &mode);
-               if (rc >= 0) {
-                       inode->i_mode = mode;
-                       if (rc > 0)
-                               rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS,
-                                                clone);
-               }
-               posix_acl_release(clone);
+               rc = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode);
+               if (rc < 0)
+                       goto cleanup; /* posix_acl_release(NULL) is no-op */
+               if (rc > 0)
+                       rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl);
 cleanup:
                posix_acl_release(acl);
        } else