]> Pileus Git - ~andy/linux/blobdiff - fs/namei.c
fs: add get_acl helper
[~andy/linux] / fs / namei.c
index 3531deebad3084104e6a9fca7116ba68890ad5af..bcb838e2e52f24593da609abba67dc5ab5336947 100644 (file)
@@ -235,27 +235,9 @@ static int check_acl(struct inode *inode, int mask)
                return posix_acl_permission(inode, acl, mask & ~MAY_NOT_BLOCK);
        }
 
-       acl = get_cached_acl(inode, ACL_TYPE_ACCESS);
-
-       /*
-        * A filesystem can force a ACL callback by just never filling the
-        * ACL cache. But normally you'd fill the cache either at inode
-        * instantiation time, or on the first ->get_acl call.
-        *
-        * If the filesystem doesn't have a get_acl() function at all, we'll
-        * just create the negative cache entry.
-        */
-       if (acl == ACL_NOT_CACHED) {
-               if (inode->i_op->get_acl) {
-                       acl = inode->i_op->get_acl(inode, ACL_TYPE_ACCESS);
-                       if (IS_ERR(acl))
-                               return PTR_ERR(acl);
-               } else {
-                       set_cached_acl(inode, ACL_TYPE_ACCESS, NULL);
-                       return -EAGAIN;
-               }
-       }
-
+       acl = 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);