提交 6d848a48 编写于 作者: L Linus Torvalds

shmfs: use 'check_acl' instead of 'permission'

shmfs wants purely standard POSIX ACL semantics, so we can use the new
generic VFS layer POSIX ACL checking rather than cooking our own
'permission()' function.
Reviewed-by: NJames Morris <jmorris@namei.org>
Acked-by: NSerge Hallyn <serue@us.ibm.com>
Acked-by: NHugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5909ccaa
...@@ -39,7 +39,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) ...@@ -39,7 +39,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
} }
#ifdef CONFIG_TMPFS_POSIX_ACL #ifdef CONFIG_TMPFS_POSIX_ACL
int shmem_permission(struct inode *, int); int shmem_check_acl(struct inode *, int);
int shmem_acl_init(struct inode *, struct inode *); int shmem_acl_init(struct inode *, struct inode *);
extern struct xattr_handler shmem_xattr_acl_access_handler; extern struct xattr_handler shmem_xattr_acl_access_handler;
......
...@@ -2446,7 +2446,7 @@ static const struct inode_operations shmem_inode_operations = { ...@@ -2446,7 +2446,7 @@ static const struct inode_operations shmem_inode_operations = {
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
.listxattr = generic_listxattr, .listxattr = generic_listxattr,
.removexattr = generic_removexattr, .removexattr = generic_removexattr,
.permission = shmem_permission, .check_acl = shmem_check_acl,
#endif #endif
}; };
...@@ -2469,7 +2469,7 @@ static const struct inode_operations shmem_dir_inode_operations = { ...@@ -2469,7 +2469,7 @@ static const struct inode_operations shmem_dir_inode_operations = {
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
.listxattr = generic_listxattr, .listxattr = generic_listxattr,
.removexattr = generic_removexattr, .removexattr = generic_removexattr,
.permission = shmem_permission, .check_acl = shmem_check_acl,
#endif #endif
}; };
...@@ -2480,7 +2480,7 @@ static const struct inode_operations shmem_special_inode_operations = { ...@@ -2480,7 +2480,7 @@ static const struct inode_operations shmem_special_inode_operations = {
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
.listxattr = generic_listxattr, .listxattr = generic_listxattr,
.removexattr = generic_removexattr, .removexattr = generic_removexattr,
.permission = shmem_permission, .check_acl = shmem_check_acl,
#endif #endif
}; };
......
...@@ -157,7 +157,7 @@ shmem_acl_init(struct inode *inode, struct inode *dir) ...@@ -157,7 +157,7 @@ shmem_acl_init(struct inode *inode, struct inode *dir)
/** /**
* shmem_check_acl - check_acl() callback for generic_permission() * shmem_check_acl - check_acl() callback for generic_permission()
*/ */
static int int
shmem_check_acl(struct inode *inode, int mask) shmem_check_acl(struct inode *inode, int mask)
{ {
struct posix_acl *acl = shmem_get_acl(inode, ACL_TYPE_ACCESS); struct posix_acl *acl = shmem_get_acl(inode, ACL_TYPE_ACCESS);
...@@ -169,12 +169,3 @@ shmem_check_acl(struct inode *inode, int mask) ...@@ -169,12 +169,3 @@ shmem_check_acl(struct inode *inode, int mask)
} }
return -EAGAIN; return -EAGAIN;
} }
/**
* shmem_permission - permission() inode operation
*/
int
shmem_permission(struct inode *inode, int mask)
{
return generic_permission(inode, mask, shmem_check_acl);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册