]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/ext2/acl.c
[PATCH] sanitize ->permission() prototype
[mirror_ubuntu-artful-kernel.git] / fs / ext2 / acl.c
index da52b4a5db64005173124575e63161ed1d6c3d35..ae8c4f850b27d0e83e28e684a07637a992abbe69 100644 (file)
@@ -89,8 +89,8 @@ ext2_acl_to_disk(const struct posix_acl *acl, size_t *size)
        size_t n;
 
        *size = ext2_acl_size(acl->a_count);
-       ext_acl = (ext2_acl_header *)kmalloc(sizeof(ext2_acl_header) +
-               acl->a_count * sizeof(ext2_acl_entry), GFP_KERNEL);
+       ext_acl = kmalloc(sizeof(ext2_acl_header) + acl->a_count *
+                       sizeof(ext2_acl_entry), GFP_KERNEL);
        if (!ext_acl)
                return ERR_PTR(-ENOMEM);
        ext_acl->a_version = cpu_to_le32(EXT2_ACL_VERSION);
@@ -294,7 +294,7 @@ ext2_check_acl(struct inode *inode, int mask)
 }
 
 int
-ext2_permission(struct inode *inode, int mask, struct nameidata *nd)
+ext2_permission(struct inode *inode, int mask)
 {
        return generic_permission(inode, mask, ext2_check_acl);
 }
@@ -464,7 +464,7 @@ ext2_xattr_set_acl(struct inode *inode, int type, const void *value,
 
        if (!test_opt(inode->i_sb, POSIX_ACL))
                return -EOPNOTSUPP;
-       if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+       if (!is_owner_or_cap(inode))
                return -EPERM;
 
        if (value) {