aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/acl.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-08 19:54:52 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 08:17:04 -0400
commit05fc0790b6c9c611129f2f712d00b6a8a364e8d2 (patch)
treeaeecb1d6cab36ed133d1432127b6f8095f267b0a /fs/jfs/acl.c
parentd4bfe2f76d785cc77611a4bda8cedaff358d8c7d (diff)
switch jfs to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jfs/acl.c')
-rw-r--r--fs/jfs/acl.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 06ca1b8d2054..5fcfc9857c11 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -31,7 +31,6 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
31{ 31{
32 struct posix_acl *acl; 32 struct posix_acl *acl;
33 char *ea_name; 33 char *ea_name;
34 struct jfs_inode_info *ji = JFS_IP(inode);
35 struct posix_acl **p_acl; 34 struct posix_acl **p_acl;
36 int size; 35 int size;
37 char *value = NULL; 36 char *value = NULL;
@@ -39,17 +38,17 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
39 switch(type) { 38 switch(type) {
40 case ACL_TYPE_ACCESS: 39 case ACL_TYPE_ACCESS:
41 ea_name = POSIX_ACL_XATTR_ACCESS; 40 ea_name = POSIX_ACL_XATTR_ACCESS;
42 p_acl = &ji->i_acl; 41 p_acl = &inode->i_acl;
43 break; 42 break;
44 case ACL_TYPE_DEFAULT: 43 case ACL_TYPE_DEFAULT:
45 ea_name = POSIX_ACL_XATTR_DEFAULT; 44 ea_name = POSIX_ACL_XATTR_DEFAULT;
46 p_acl = &ji->i_default_acl; 45 p_acl = &inode->i_default_acl;
47 break; 46 break;
48 default: 47 default:
49 return ERR_PTR(-EINVAL); 48 return ERR_PTR(-EINVAL);
50 } 49 }
51 50
52 if (*p_acl != JFS_ACL_NOT_CACHED) 51 if (*p_acl != ACL_NOT_CACHED)
53 return posix_acl_dup(*p_acl); 52 return posix_acl_dup(*p_acl);
54 53
55 size = __jfs_getxattr(inode, ea_name, NULL, 0); 54 size = __jfs_getxattr(inode, ea_name, NULL, 0);
@@ -80,7 +79,6 @@ static int jfs_set_acl(tid_t tid, struct inode *inode, int type,
80 struct posix_acl *acl) 79 struct posix_acl *acl)
81{ 80{
82 char *ea_name; 81 char *ea_name;
83 struct jfs_inode_info *ji = JFS_IP(inode);
84 struct posix_acl **p_acl; 82 struct posix_acl **p_acl;
85 int rc; 83 int rc;
86 int size = 0; 84 int size = 0;
@@ -92,11 +90,11 @@ static int jfs_set_acl(tid_t tid, struct inode *inode, int type,
92 switch(type) { 90 switch(type) {
93 case ACL_TYPE_ACCESS: 91 case ACL_TYPE_ACCESS:
94 ea_name = POSIX_ACL_XATTR_ACCESS; 92 ea_name = POSIX_ACL_XATTR_ACCESS;
95 p_acl = &ji->i_acl; 93 p_acl = &inode->i_acl;
96 break; 94 break;
97 case ACL_TYPE_DEFAULT: 95 case ACL_TYPE_DEFAULT:
98 ea_name = POSIX_ACL_XATTR_DEFAULT; 96 ea_name = POSIX_ACL_XATTR_DEFAULT;
99 p_acl = &ji->i_default_acl; 97 p_acl = &inode->i_default_acl;
100 if (!S_ISDIR(inode->i_mode)) 98 if (!S_ISDIR(inode->i_mode))
101 return acl ? -EACCES : 0; 99 return acl ? -EACCES : 0;
102 break; 100 break;
@@ -117,7 +115,7 @@ out:
117 kfree(value); 115 kfree(value);
118 116
119 if (!rc) { 117 if (!rc) {
120 if (*p_acl && (*p_acl != JFS_ACL_NOT_CACHED)) 118 if (*p_acl && (*p_acl != ACL_NOT_CACHED))
121 posix_acl_release(*p_acl); 119 posix_acl_release(*p_acl);
122 *p_acl = posix_acl_dup(acl); 120 *p_acl = posix_acl_dup(acl);
123 } 121 }
@@ -126,17 +124,15 @@ out:
126 124
127static int jfs_check_acl(struct inode *inode, int mask) 125static int jfs_check_acl(struct inode *inode, int mask)
128{ 126{
129 struct jfs_inode_info *ji = JFS_IP(inode); 127 if (inode->i_acl == ACL_NOT_CACHED) {
130
131 if (ji->i_acl == JFS_ACL_NOT_CACHED) {
132 struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); 128 struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS);
133 if (IS_ERR(acl)) 129 if (IS_ERR(acl))
134 return PTR_ERR(acl); 130 return PTR_ERR(acl);
135 posix_acl_release(acl); 131 posix_acl_release(acl);
136 } 132 }
137 133
138 if (ji->i_acl) 134 if (inode->i_acl)
139 return posix_acl_permission(inode, ji->i_acl, mask); 135 return posix_acl_permission(inode, inode->i_acl, mask);
140 return -EAGAIN; 136 return -EAGAIN;
141} 137}
142 138