aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-08 19:53:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 08:17:04 -0400
commit6582a0e6f6bc7bf64817b9e1a424782855292ab0 (patch)
tree7f7ac59f476a461a33706714e7bcb635b60977af /fs
parent5e78b435683daaaacadad1b2aeefb8904cf6acfb (diff)
switch ext3 to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext3/acl.c22
-rw-r--r--fs/ext3/acl.h4
-rw-r--r--fs/ext3/inode.c4
-rw-r--r--fs/ext3/super.c16
4 files changed, 10 insertions, 36 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index e0c745451715..a9707689d9e1 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -134,7 +134,7 @@ ext3_iget_acl(struct inode *inode, struct posix_acl **i_acl)
134 if (acl) { 134 if (acl) {
135 spin_lock(&inode->i_lock); 135 spin_lock(&inode->i_lock);
136 acl = *i_acl; 136 acl = *i_acl;
137 if (acl != EXT3_ACL_NOT_CACHED) 137 if (acl != ACL_NOT_CACHED)
138 acl = posix_acl_dup(acl); 138 acl = posix_acl_dup(acl);
139 spin_unlock(&inode->i_lock); 139 spin_unlock(&inode->i_lock);
140 } 140 }
@@ -147,7 +147,7 @@ ext3_iset_acl(struct inode *inode, struct posix_acl **i_acl,
147 struct posix_acl *acl) 147 struct posix_acl *acl)
148{ 148{
149 spin_lock(&inode->i_lock); 149 spin_lock(&inode->i_lock);
150 if (*i_acl != EXT3_ACL_NOT_CACHED) 150 if (*i_acl != ACL_NOT_CACHED)
151 posix_acl_release(*i_acl); 151 posix_acl_release(*i_acl);
152 *i_acl = posix_acl_dup(acl); 152 *i_acl = posix_acl_dup(acl);
153 spin_unlock(&inode->i_lock); 153 spin_unlock(&inode->i_lock);
@@ -161,7 +161,6 @@ ext3_iset_acl(struct inode *inode, struct posix_acl **i_acl,
161static struct posix_acl * 161static struct posix_acl *
162ext3_get_acl(struct inode *inode, int type) 162ext3_get_acl(struct inode *inode, int type)
163{ 163{
164 struct ext3_inode_info *ei = EXT3_I(inode);
165 int name_index; 164 int name_index;
166 char *value = NULL; 165 char *value = NULL;
167 struct posix_acl *acl; 166 struct posix_acl *acl;
@@ -172,15 +171,15 @@ ext3_get_acl(struct inode *inode, int type)
172 171
173 switch(type) { 172 switch(type) {
174 case ACL_TYPE_ACCESS: 173 case ACL_TYPE_ACCESS:
175 acl = ext3_iget_acl(inode, &ei->i_acl); 174 acl = ext3_iget_acl(inode, &inode->i_acl);
176 if (acl != EXT3_ACL_NOT_CACHED) 175 if (acl != ACL_NOT_CACHED)
177 return acl; 176 return acl;
178 name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS; 177 name_index = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS;
179 break; 178 break;
180 179
181 case ACL_TYPE_DEFAULT: 180 case ACL_TYPE_DEFAULT:
182 acl = ext3_iget_acl(inode, &ei->i_default_acl); 181 acl = ext3_iget_acl(inode, &inode->i_default_acl);
183 if (acl != EXT3_ACL_NOT_CACHED) 182 if (acl != ACL_NOT_CACHED)
184 return acl; 183 return acl;
185 name_index = EXT3_XATTR_INDEX_POSIX_ACL_DEFAULT; 184 name_index = EXT3_XATTR_INDEX_POSIX_ACL_DEFAULT;
186 break; 185 break;
@@ -206,11 +205,11 @@ ext3_get_acl(struct inode *inode, int type)
206 if (!IS_ERR(acl)) { 205 if (!IS_ERR(acl)) {
207 switch(type) { 206 switch(type) {
208 case ACL_TYPE_ACCESS: 207 case ACL_TYPE_ACCESS:
209 ext3_iset_acl(inode, &ei->i_acl, acl); 208 ext3_iset_acl(inode, &inode->i_acl, acl);
210 break; 209 break;
211 210
212 case ACL_TYPE_DEFAULT: 211 case ACL_TYPE_DEFAULT:
213 ext3_iset_acl(inode, &ei->i_default_acl, acl); 212 ext3_iset_acl(inode, &inode->i_default_acl, acl);
214 break; 213 break;
215 } 214 }
216 } 215 }
@@ -226,7 +225,6 @@ static int
226ext3_set_acl(handle_t *handle, struct inode *inode, int type, 225ext3_set_acl(handle_t *handle, struct inode *inode, int type,
227 struct posix_acl *acl) 226 struct posix_acl *acl)
228{ 227{
229 struct ext3_inode_info *ei = EXT3_I(inode);
230 int name_index; 228 int name_index;
231 void *value = NULL; 229 void *value = NULL;
232 size_t size = 0; 230 size_t size = 0;
@@ -274,11 +272,11 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type,
274 if (!error) { 272 if (!error) {
275 switch(type) { 273 switch(type) {
276 case ACL_TYPE_ACCESS: 274 case ACL_TYPE_ACCESS:
277 ext3_iset_acl(inode, &ei->i_acl, acl); 275 ext3_iset_acl(inode, &inode->i_acl, acl);
278 break; 276 break;
279 277
280 case ACL_TYPE_DEFAULT: 278 case ACL_TYPE_DEFAULT:
281 ext3_iset_acl(inode, &ei->i_default_acl, acl); 279 ext3_iset_acl(inode, &inode->i_default_acl, acl);
282 break; 280 break;
283 } 281 }
284 } 282 }
diff --git a/fs/ext3/acl.h b/fs/ext3/acl.h
index 42da16b8cac0..07d15a3a5969 100644
--- a/fs/ext3/acl.h
+++ b/fs/ext3/acl.h
@@ -53,10 +53,6 @@ static inline int ext3_acl_count(size_t size)
53 53
54#ifdef CONFIG_EXT3_FS_POSIX_ACL 54#ifdef CONFIG_EXT3_FS_POSIX_ACL
55 55
56/* Value for inode->u.ext3_i.i_acl and inode->u.ext3_i.i_default_acl
57 if the ACL has not been cached */
58#define EXT3_ACL_NOT_CACHED ((void *)-1)
59
60/* acl.c */ 56/* acl.c */
61extern int ext3_permission (struct inode *, int); 57extern int ext3_permission (struct inode *, int);
62extern int ext3_acl_chmod (struct inode *); 58extern int ext3_acl_chmod (struct inode *);
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 05dea8132fc0..5f51fed5c750 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -2752,10 +2752,6 @@ struct inode *ext3_iget(struct super_block *sb, unsigned long ino)
2752 return inode; 2752 return inode;
2753 2753
2754 ei = EXT3_I(inode); 2754 ei = EXT3_I(inode);
2755#ifdef CONFIG_EXT3_FS_POSIX_ACL
2756 ei->i_acl = EXT3_ACL_NOT_CACHED;
2757 ei->i_default_acl = EXT3_ACL_NOT_CACHED;
2758#endif
2759 ei->i_block_alloc_info = NULL; 2755 ei->i_block_alloc_info = NULL;
2760 2756
2761 ret = __ext3_get_inode_loc(inode, &iloc, 0); 2757 ret = __ext3_get_inode_loc(inode, &iloc, 0);
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 601e881e6105..524b349c6299 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -464,10 +464,6 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
464 ei = kmem_cache_alloc(ext3_inode_cachep, GFP_NOFS); 464 ei = kmem_cache_alloc(ext3_inode_cachep, GFP_NOFS);
465 if (!ei) 465 if (!ei)
466 return NULL; 466 return NULL;
467#ifdef CONFIG_EXT3_FS_POSIX_ACL
468 ei->i_acl = EXT3_ACL_NOT_CACHED;
469 ei->i_default_acl = EXT3_ACL_NOT_CACHED;
470#endif
471 ei->i_block_alloc_info = NULL; 467 ei->i_block_alloc_info = NULL;
472 ei->vfs_inode.i_version = 1; 468 ei->vfs_inode.i_version = 1;
473 return &ei->vfs_inode; 469 return &ei->vfs_inode;
@@ -518,18 +514,6 @@ static void destroy_inodecache(void)
518static void ext3_clear_inode(struct inode *inode) 514static void ext3_clear_inode(struct inode *inode)
519{ 515{
520 struct ext3_block_alloc_info *rsv = EXT3_I(inode)->i_block_alloc_info; 516 struct ext3_block_alloc_info *rsv = EXT3_I(inode)->i_block_alloc_info;
521#ifdef CONFIG_EXT3_FS_POSIX_ACL
522 if (EXT3_I(inode)->i_acl &&
523 EXT3_I(inode)->i_acl != EXT3_ACL_NOT_CACHED) {
524 posix_acl_release(EXT3_I(inode)->i_acl);
525 EXT3_I(inode)->i_acl = EXT3_ACL_NOT_CACHED;
526 }
527 if (EXT3_I(inode)->i_default_acl &&
528 EXT3_I(inode)->i_default_acl != EXT3_ACL_NOT_CACHED) {
529 posix_acl_release(EXT3_I(inode)->i_default_acl);
530 EXT3_I(inode)->i_default_acl = EXT3_ACL_NOT_CACHED;
531 }
532#endif
533 ext3_discard_reservation(inode); 517 ext3_discard_reservation(inode);
534 EXT3_I(inode)->i_block_alloc_info = NULL; 518 EXT3_I(inode)->i_block_alloc_info = NULL;
535 if (unlikely(rsv)) 519 if (unlikely(rsv))