diff options
author | Christoph Hellwig <hch@lst.de> | 2009-11-03 10:44:44 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-16 12:16:49 -0500 |
commit | 1c7c474c31aea6d5cb2fb35f31d9e9e91ae466b1 (patch) | |
tree | 89a5fd1146be1744ce3ac94789542841512315b8 /mm/shmem.c | |
parent | 431547b3c4533b8c7fd150ab36980b9a3147797b (diff) |
make generic_acl slightly more generic
Now that we cache the ACL pointers in the generic inode all the generic_acl
cruft can go away and generic_acl.c can directly implement xattr handlers
dealing with the full Posix ACL semantics for in-memory filesystems.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 3cd32c2ea0a0..f8485062f3ba 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -41,6 +41,7 @@ static struct vfsmount *shm_mnt; | |||
41 | 41 | ||
42 | #include <linux/xattr.h> | 42 | #include <linux/xattr.h> |
43 | #include <linux/exportfs.h> | 43 | #include <linux/exportfs.h> |
44 | #include <linux/posix_acl.h> | ||
44 | #include <linux/generic_acl.h> | 45 | #include <linux/generic_acl.h> |
45 | #include <linux/mman.h> | 46 | #include <linux/mman.h> |
46 | #include <linux/string.h> | 47 | #include <linux/string.h> |
@@ -809,7 +810,7 @@ static int shmem_notify_change(struct dentry *dentry, struct iattr *attr) | |||
809 | error = inode_setattr(inode, attr); | 810 | error = inode_setattr(inode, attr); |
810 | #ifdef CONFIG_TMPFS_POSIX_ACL | 811 | #ifdef CONFIG_TMPFS_POSIX_ACL |
811 | if (!error && (attr->ia_valid & ATTR_MODE)) | 812 | if (!error && (attr->ia_valid & ATTR_MODE)) |
812 | error = generic_acl_chmod(inode, &shmem_acl_ops); | 813 | error = generic_acl_chmod(inode); |
813 | #endif | 814 | #endif |
814 | if (page) | 815 | if (page) |
815 | page_cache_release(page); | 816 | page_cache_release(page); |
@@ -1823,11 +1824,13 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) | |||
1823 | return error; | 1824 | return error; |
1824 | } | 1825 | } |
1825 | } | 1826 | } |
1826 | error = shmem_acl_init(inode, dir); | 1827 | #ifdef CONFIG_TMPFS_POSIX_ACL |
1828 | error = generic_acl_init(inode, dir); | ||
1827 | if (error) { | 1829 | if (error) { |
1828 | iput(inode); | 1830 | iput(inode); |
1829 | return error; | 1831 | return error; |
1830 | } | 1832 | } |
1833 | #endif | ||
1831 | if (dir->i_mode & S_ISGID) { | 1834 | if (dir->i_mode & S_ISGID) { |
1832 | inode->i_gid = dir->i_gid; | 1835 | inode->i_gid = dir->i_gid; |
1833 | if (S_ISDIR(mode)) | 1836 | if (S_ISDIR(mode)) |
@@ -2074,8 +2077,8 @@ static struct xattr_handler shmem_xattr_security_handler = { | |||
2074 | }; | 2077 | }; |
2075 | 2078 | ||
2076 | static struct xattr_handler *shmem_xattr_handlers[] = { | 2079 | static struct xattr_handler *shmem_xattr_handlers[] = { |
2077 | &shmem_xattr_acl_access_handler, | 2080 | &generic_acl_access_handler, |
2078 | &shmem_xattr_acl_default_handler, | 2081 | &generic_acl_default_handler, |
2079 | &shmem_xattr_security_handler, | 2082 | &shmem_xattr_security_handler, |
2080 | NULL | 2083 | NULL |
2081 | }; | 2084 | }; |
@@ -2454,7 +2457,7 @@ static const struct inode_operations shmem_inode_operations = { | |||
2454 | .getxattr = generic_getxattr, | 2457 | .getxattr = generic_getxattr, |
2455 | .listxattr = generic_listxattr, | 2458 | .listxattr = generic_listxattr, |
2456 | .removexattr = generic_removexattr, | 2459 | .removexattr = generic_removexattr, |
2457 | .check_acl = shmem_check_acl, | 2460 | .check_acl = generic_check_acl, |
2458 | #endif | 2461 | #endif |
2459 | 2462 | ||
2460 | }; | 2463 | }; |
@@ -2477,7 +2480,7 @@ static const struct inode_operations shmem_dir_inode_operations = { | |||
2477 | .getxattr = generic_getxattr, | 2480 | .getxattr = generic_getxattr, |
2478 | .listxattr = generic_listxattr, | 2481 | .listxattr = generic_listxattr, |
2479 | .removexattr = generic_removexattr, | 2482 | .removexattr = generic_removexattr, |
2480 | .check_acl = shmem_check_acl, | 2483 | .check_acl = generic_check_acl, |
2481 | #endif | 2484 | #endif |
2482 | }; | 2485 | }; |
2483 | 2486 | ||
@@ -2488,7 +2491,7 @@ static const struct inode_operations shmem_special_inode_operations = { | |||
2488 | .getxattr = generic_getxattr, | 2491 | .getxattr = generic_getxattr, |
2489 | .listxattr = generic_listxattr, | 2492 | .listxattr = generic_listxattr, |
2490 | .removexattr = generic_removexattr, | 2493 | .removexattr = generic_removexattr, |
2491 | .check_acl = shmem_check_acl, | 2494 | .check_acl = generic_check_acl, |
2492 | #endif | 2495 | #endif |
2493 | }; | 2496 | }; |
2494 | 2497 | ||