kill check_acl callback of generic_permission()

its value depends only on inode and does not change; we might as
well store it in ->i_op->check_acl and be done with that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2011-06-20 11:31:30 -04:00
parent 07b8ce1ee8
commit 178ea73521
20 changed files with 47 additions and 37 deletions

View File

@@ -312,4 +312,5 @@ const struct inode_operations reiserfs_file_inode_operations = {
.listxattr = reiserfs_listxattr,
.removexattr = reiserfs_removexattr,
.permission = reiserfs_permission,
.check_acl = reiserfs_check_acl,
};

View File

@@ -1529,6 +1529,7 @@ const struct inode_operations reiserfs_dir_inode_operations = {
.listxattr = reiserfs_listxattr,
.removexattr = reiserfs_removexattr,
.permission = reiserfs_permission,
.check_acl = reiserfs_check_acl,
};
/*
@@ -1545,6 +1546,7 @@ const struct inode_operations reiserfs_symlink_inode_operations = {
.listxattr = reiserfs_listxattr,
.removexattr = reiserfs_removexattr,
.permission = reiserfs_permission,
.check_acl = reiserfs_check_acl,
};
@@ -1558,5 +1560,5 @@ const struct inode_operations reiserfs_special_inode_operations = {
.listxattr = reiserfs_listxattr,
.removexattr = reiserfs_removexattr,
.permission = reiserfs_permission,
.check_acl = reiserfs_check_acl,
};

View File

@@ -868,11 +868,17 @@ out:
return err;
}
static int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags)
int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags)
{
struct posix_acl *acl;
int error = -EAGAIN; /* do regular unix permission checks by default */
/*
* Stat data v1 doesn't support ACLs.
*/
if (get_inode_sd_version(inode) == STAT_DATA_V1)
return -EAGAIN;
if (flags & IPERM_FLAG_RCU)
return -ECHILD;
@@ -961,15 +967,7 @@ int reiserfs_permission(struct inode *inode, int mask, unsigned int flags)
if (IS_PRIVATE(inode))
return 0;
#ifdef CONFIG_REISERFS_FS_XATTR
/*
* Stat data v1 doesn't support ACLs.
*/
if (get_inode_sd_version(inode) != STAT_DATA_V1)
return generic_permission(inode, mask, flags,
reiserfs_check_acl);
#endif
return generic_permission(inode, mask, flags, NULL);
return generic_permission(inode, mask, flags);
}
static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd)