Staging: wlags49_h2: fix comments coding style issue in ap_h2.c
[safe/jmp/linux-2.6] / fs / jfs / acl.c
index f272bf0..1057a49 100644 (file)
@@ -19,8 +19,8 @@
  */
 
 #include <linux/sched.h>
+#include <linux/slab.h>
 #include <linux/fs.h>
-#include <linux/quotaops.h>
 #include <linux/posix_acl_xattr.h>
 #include "jfs_incore.h"
 #include "jfs_txnmgr.h"
@@ -67,10 +67,8 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
                acl = posix_acl_from_xattr(value, size);
        }
        kfree(value);
-       if (!IS_ERR(acl)) {
+       if (!IS_ERR(acl))
                set_cached_acl(inode, type, acl);
-               posix_acl_release(acl);
-       }
        return acl;
 }
 
@@ -116,25 +114,21 @@ out:
        return rc;
 }
 
-static int jfs_check_acl(struct inode *inode, int mask)
+int jfs_check_acl(struct inode *inode, int mask)
 {
-       if (inode->i_acl == ACL_NOT_CACHED) {
-               struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS);
-               if (IS_ERR(acl))
-                       return PTR_ERR(acl);
+       struct posix_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;
        }
 
-       if (inode->i_acl)
-               return posix_acl_permission(inode, inode->i_acl, mask);
        return -EAGAIN;
 }
 
-int jfs_permission(struct inode *inode, int mask)
-{
-       return generic_permission(inode, mask, jfs_check_acl);
-}
-
 int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir)
 {
        struct posix_acl *acl = NULL;
@@ -180,7 +174,7 @@ cleanup:
        return rc;
 }
 
-static int jfs_acl_chmod(struct inode *inode)
+int jfs_acl_chmod(struct inode *inode)
 {
        struct posix_acl *acl, *clone;
        int rc;
@@ -211,26 +205,3 @@ static int jfs_acl_chmod(struct inode *inode)
        posix_acl_release(clone);
        return rc;
 }
-
-int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
-{
-       struct inode *inode = dentry->d_inode;
-       int rc;
-
-       rc = inode_change_ok(inode, iattr);
-       if (rc)
-               return rc;
-
-       if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
-           (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {
-               if (vfs_dq_transfer(inode, iattr))
-                       return -EDQUOT;
-       }
-
-       rc = inode_setattr(inode, iattr);
-
-       if (!rc && (iattr->ia_valid & ATTR_MODE))
-               rc = jfs_acl_chmod(inode);
-
-       return rc;
-}