shmfs: use 'check_acl' instead of 'permission'
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Aug 2009 19:04:28 +0000 (12:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Sep 2009 18:08:46 +0000 (11:08 -0700)
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: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/shmem_fs.h
mm/shmem.c
mm/shmem_acl.c

index abff6c9b413c10c118e30dc537ea7b7f5e357c8d..6d3f2f449ead2ad8f9a161ecdce945ff390fbdb8 100644 (file)
@@ -39,7 +39,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
 }
 
 #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 *);
 
 extern struct xattr_handler shmem_xattr_acl_access_handler;
index d713239ce2ce72be6097a1ad478ce1b04798773d..5a0b3d4055f347898b92f481d8ecdb793f9e62a0 100644 (file)
@@ -2446,7 +2446,7 @@ static const struct inode_operations shmem_inode_operations = {
        .getxattr       = generic_getxattr,
        .listxattr      = generic_listxattr,
        .removexattr    = generic_removexattr,
-       .permission     = shmem_permission,
+       .check_acl      = shmem_check_acl,
 #endif
 
 };
@@ -2469,7 +2469,7 @@ static const struct inode_operations shmem_dir_inode_operations = {
        .getxattr       = generic_getxattr,
        .listxattr      = generic_listxattr,
        .removexattr    = generic_removexattr,
-       .permission     = shmem_permission,
+       .check_acl      = shmem_check_acl,
 #endif
 };
 
@@ -2480,7 +2480,7 @@ static const struct inode_operations shmem_special_inode_operations = {
        .getxattr       = generic_getxattr,
        .listxattr      = generic_listxattr,
        .removexattr    = generic_removexattr,
-       .permission     = shmem_permission,
+       .check_acl      = shmem_check_acl,
 #endif
 };
 
index 606a8e757a422e83d2c714dfb9423c4f40b727dd..df2c87fdae503f97c6c38547ed3a953d5b73fc54 100644 (file)
@@ -157,7 +157,7 @@ shmem_acl_init(struct inode *inode, struct inode *dir)
 /**
  * shmem_check_acl  -  check_acl() callback for generic_permission()
  */
-static int
+int
 shmem_check_acl(struct inode *inode, int mask)
 {
        struct posix_acl *acl = shmem_get_acl(inode, ACL_TYPE_ACCESS);
@@ -169,12 +169,3 @@ shmem_check_acl(struct inode *inode, int mask)
        }
        return -EAGAIN;
 }
-
-/**
- * shmem_permission  -  permission() inode operation
- */
-int
-shmem_permission(struct inode *inode, int mask)
-{
-       return generic_permission(inode, mask, shmem_check_acl);
-}