diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-20 11:31:30 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:43:16 -0400 |
commit | 178ea73521d64ba41d7aa5488fb9f549c6d4507d (patch) | |
tree | 7fb6bfb6483577752e307a5bb2e3905658d44294 /fs/reiserfs | |
parent | 07b8ce1ee87d291ff564c02cf878fae973317a52 (diff) |
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>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/file.c | 1 | ||||
-rw-r--r-- | fs/reiserfs/namei.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/xattr.c | 18 |
3 files changed, 12 insertions, 11 deletions
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 91f080cc76c8..bbf31003d308 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -312,4 +312,5 @@ const struct inode_operations reiserfs_file_inode_operations = { | |||
312 | .listxattr = reiserfs_listxattr, | 312 | .listxattr = reiserfs_listxattr, |
313 | .removexattr = reiserfs_removexattr, | 313 | .removexattr = reiserfs_removexattr, |
314 | .permission = reiserfs_permission, | 314 | .permission = reiserfs_permission, |
315 | .check_acl = reiserfs_check_acl, | ||
315 | }; | 316 | }; |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 118662690cdf..551f1b79dbc4 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -1529,6 +1529,7 @@ const struct inode_operations reiserfs_dir_inode_operations = { | |||
1529 | .listxattr = reiserfs_listxattr, | 1529 | .listxattr = reiserfs_listxattr, |
1530 | .removexattr = reiserfs_removexattr, | 1530 | .removexattr = reiserfs_removexattr, |
1531 | .permission = reiserfs_permission, | 1531 | .permission = reiserfs_permission, |
1532 | .check_acl = reiserfs_check_acl, | ||
1532 | }; | 1533 | }; |
1533 | 1534 | ||
1534 | /* | 1535 | /* |
@@ -1545,6 +1546,7 @@ const struct inode_operations reiserfs_symlink_inode_operations = { | |||
1545 | .listxattr = reiserfs_listxattr, | 1546 | .listxattr = reiserfs_listxattr, |
1546 | .removexattr = reiserfs_removexattr, | 1547 | .removexattr = reiserfs_removexattr, |
1547 | .permission = reiserfs_permission, | 1548 | .permission = reiserfs_permission, |
1549 | .check_acl = reiserfs_check_acl, | ||
1548 | 1550 | ||
1549 | }; | 1551 | }; |
1550 | 1552 | ||
@@ -1558,5 +1560,5 @@ const struct inode_operations reiserfs_special_inode_operations = { | |||
1558 | .listxattr = reiserfs_listxattr, | 1560 | .listxattr = reiserfs_listxattr, |
1559 | .removexattr = reiserfs_removexattr, | 1561 | .removexattr = reiserfs_removexattr, |
1560 | .permission = reiserfs_permission, | 1562 | .permission = reiserfs_permission, |
1561 | 1563 | .check_acl = reiserfs_check_acl, | |
1562 | }; | 1564 | }; |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index d78089690965..ddc5301d2986 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -868,11 +868,17 @@ out: | |||
868 | return err; | 868 | return err; |
869 | } | 869 | } |
870 | 870 | ||
871 | static int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags) | 871 | int reiserfs_check_acl(struct inode *inode, int mask, unsigned int flags) |
872 | { | 872 | { |
873 | struct posix_acl *acl; | 873 | struct posix_acl *acl; |
874 | int error = -EAGAIN; /* do regular unix permission checks by default */ | 874 | int error = -EAGAIN; /* do regular unix permission checks by default */ |
875 | 875 | ||
876 | /* | ||
877 | * Stat data v1 doesn't support ACLs. | ||
878 | */ | ||
879 | if (get_inode_sd_version(inode) == STAT_DATA_V1) | ||
880 | return -EAGAIN; | ||
881 | |||
876 | if (flags & IPERM_FLAG_RCU) | 882 | if (flags & IPERM_FLAG_RCU) |
877 | return -ECHILD; | 883 | return -ECHILD; |
878 | 884 | ||
@@ -961,15 +967,7 @@ int reiserfs_permission(struct inode *inode, int mask, unsigned int flags) | |||
961 | if (IS_PRIVATE(inode)) | 967 | if (IS_PRIVATE(inode)) |
962 | return 0; | 968 | return 0; |
963 | 969 | ||
964 | #ifdef CONFIG_REISERFS_FS_XATTR | 970 | return generic_permission(inode, mask, flags); |
965 | /* | ||
966 | * Stat data v1 doesn't support ACLs. | ||
967 | */ | ||
968 | if (get_inode_sd_version(inode) != STAT_DATA_V1) | ||
969 | return generic_permission(inode, mask, flags, | ||
970 | reiserfs_check_acl); | ||
971 | #endif | ||
972 | return generic_permission(inode, mask, flags, NULL); | ||
973 | } | 971 | } |
974 | 972 | ||
975 | static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd) | 973 | static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd) |