aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-08 21:07:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 08:17:06 -0400
commit281eede0328c84a8f20e0e85b807d5b51c3de4f2 (patch)
tree9eb0184c7066f27593f2fd75db1593bf688c330f
parent7a77b15d9294749809de918e24bebc39e0fbc9ab (diff)
switch reiserfs to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/reiserfs/inode.c4
-rw-r--r--fs/reiserfs/super.c24
-rw-r--r--fs/reiserfs/xattr_acl.c10
-rw-r--r--include/linux/reiserfs_acl.h17
-rw-r--r--include/linux/reiserfs_fs_i.h4
5 files changed, 4 insertions, 55 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 6fd0f47e45db..a14d6cd9eeda 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -1131,8 +1131,6 @@ static void init_inode(struct inode *inode, struct treepath *path)
1131 REISERFS_I(inode)->i_trans_id = 0; 1131 REISERFS_I(inode)->i_trans_id = 0;
1132 REISERFS_I(inode)->i_jl = NULL; 1132 REISERFS_I(inode)->i_jl = NULL;
1133 mutex_init(&(REISERFS_I(inode)->i_mmap)); 1133 mutex_init(&(REISERFS_I(inode)->i_mmap));
1134 reiserfs_init_acl_access(inode);
1135 reiserfs_init_acl_default(inode);
1136 reiserfs_init_xattr_rwsem(inode); 1134 reiserfs_init_xattr_rwsem(inode);
1137 1135
1138 if (stat_data_v1(ih)) { 1136 if (stat_data_v1(ih)) {
@@ -1834,8 +1832,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1834 REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK; 1832 REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK;
1835 sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode); 1833 sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode);
1836 mutex_init(&(REISERFS_I(inode)->i_mmap)); 1834 mutex_init(&(REISERFS_I(inode)->i_mmap));
1837 reiserfs_init_acl_access(inode);
1838 reiserfs_init_acl_default(inode);
1839 reiserfs_init_xattr_rwsem(inode); 1835 reiserfs_init_xattr_rwsem(inode);
1840 1836
1841 /* key to search for correct place for new stat data */ 1837 /* key to search for correct place for new stat data */
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index b194451fc04b..d3aeb061612b 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -529,10 +529,6 @@ static void init_once(void *foo)
529 529
530 INIT_LIST_HEAD(&ei->i_prealloc_list); 530 INIT_LIST_HEAD(&ei->i_prealloc_list);
531 inode_init_once(&ei->vfs_inode); 531 inode_init_once(&ei->vfs_inode);
532#ifdef CONFIG_REISERFS_FS_POSIX_ACL
533 ei->i_acl_access = ACL_NOT_CACHED;
534 ei->i_acl_default = ACL_NOT_CACHED;
535#endif
536} 532}
537 533
538static int init_inodecache(void) 534static int init_inodecache(void)
@@ -580,25 +576,6 @@ static void reiserfs_dirty_inode(struct inode *inode)
580 reiserfs_write_unlock(inode->i_sb); 576 reiserfs_write_unlock(inode->i_sb);
581} 577}
582 578
583#ifdef CONFIG_REISERFS_FS_POSIX_ACL
584static void reiserfs_clear_inode(struct inode *inode)
585{
586 struct posix_acl *acl;
587
588 acl = REISERFS_I(inode)->i_acl_access;
589 if (acl && acl != ACL_NOT_CACHED)
590 posix_acl_release(acl);
591 REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
592
593 acl = REISERFS_I(inode)->i_acl_default;
594 if (acl && acl != ACL_NOT_CACHED)
595 posix_acl_release(acl);
596 REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
597}
598#else
599#define reiserfs_clear_inode NULL
600#endif
601
602#ifdef CONFIG_QUOTA 579#ifdef CONFIG_QUOTA
603static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, 580static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
604 size_t, loff_t); 581 size_t, loff_t);
@@ -612,7 +589,6 @@ static const struct super_operations reiserfs_sops = {
612 .write_inode = reiserfs_write_inode, 589 .write_inode = reiserfs_write_inode,
613 .dirty_inode = reiserfs_dirty_inode, 590 .dirty_inode = reiserfs_dirty_inode,
614 .delete_inode = reiserfs_delete_inode, 591 .delete_inode = reiserfs_delete_inode,
615 .clear_inode = reiserfs_clear_inode,
616 .put_super = reiserfs_put_super, 592 .put_super = reiserfs_put_super,
617 .write_super = reiserfs_write_super, 593 .write_super = reiserfs_write_super,
618 .sync_fs = reiserfs_sync_fs, 594 .sync_fs = reiserfs_sync_fs,
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 7b3aeb9327d3..b6e473faa8b8 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -223,16 +223,15 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
223 struct posix_acl *acl, **p_acl; 223 struct posix_acl *acl, **p_acl;
224 int size; 224 int size;
225 int retval; 225 int retval;
226 struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode);
227 226
228 switch (type) { 227 switch (type) {
229 case ACL_TYPE_ACCESS: 228 case ACL_TYPE_ACCESS:
230 name = POSIX_ACL_XATTR_ACCESS; 229 name = POSIX_ACL_XATTR_ACCESS;
231 p_acl = &reiserfs_i->i_acl_access; 230 p_acl = &inode->i_acl;
232 break; 231 break;
233 case ACL_TYPE_DEFAULT: 232 case ACL_TYPE_DEFAULT:
234 name = POSIX_ACL_XATTR_DEFAULT; 233 name = POSIX_ACL_XATTR_DEFAULT;
235 p_acl = &reiserfs_i->i_acl_default; 234 p_acl = &inode->i_default_acl;
236 break; 235 break;
237 default: 236 default:
238 return ERR_PTR(-EINVAL); 237 return ERR_PTR(-EINVAL);
@@ -288,7 +287,6 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
288 struct posix_acl **p_acl; 287 struct posix_acl **p_acl;
289 size_t size = 0; 288 size_t size = 0;
290 int error; 289 int error;
291 struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode);
292 290
293 if (S_ISLNK(inode->i_mode)) 291 if (S_ISLNK(inode->i_mode))
294 return -EOPNOTSUPP; 292 return -EOPNOTSUPP;
@@ -296,7 +294,7 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
296 switch (type) { 294 switch (type) {
297 case ACL_TYPE_ACCESS: 295 case ACL_TYPE_ACCESS:
298 name = POSIX_ACL_XATTR_ACCESS; 296 name = POSIX_ACL_XATTR_ACCESS;
299 p_acl = &reiserfs_i->i_acl_access; 297 p_acl = &inode->i_acl;
300 if (acl) { 298 if (acl) {
301 mode_t mode = inode->i_mode; 299 mode_t mode = inode->i_mode;
302 error = posix_acl_equiv_mode(acl, &mode); 300 error = posix_acl_equiv_mode(acl, &mode);
@@ -311,7 +309,7 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
311 break; 309 break;
312 case ACL_TYPE_DEFAULT: 310 case ACL_TYPE_DEFAULT:
313 name = POSIX_ACL_XATTR_DEFAULT; 311 name = POSIX_ACL_XATTR_DEFAULT;
314 p_acl = &reiserfs_i->i_acl_default; 312 p_acl = &inode->i_default_acl;
315 if (!S_ISDIR(inode->i_mode)) 313 if (!S_ISDIR(inode->i_mode))
316 return acl ? -EACCES : 0; 314 return acl ? -EACCES : 0;
317 break; 315 break;
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 8f4d8d718b10..b4448853900e 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -56,15 +56,6 @@ int reiserfs_cache_default_acl(struct inode *dir);
56extern struct xattr_handler reiserfs_posix_acl_default_handler; 56extern struct xattr_handler reiserfs_posix_acl_default_handler;
57extern struct xattr_handler reiserfs_posix_acl_access_handler; 57extern struct xattr_handler reiserfs_posix_acl_access_handler;
58 58
59static inline void reiserfs_init_acl_access(struct inode *inode)
60{
61 REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
62}
63
64static inline void reiserfs_init_acl_default(struct inode *inode)
65{
66 REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
67}
68#else 59#else
69 60
70#define reiserfs_cache_default_acl(inode) 0 61#define reiserfs_cache_default_acl(inode) 0
@@ -86,12 +77,4 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
86{ 77{
87 return 0; 78 return 0;
88} 79}
89
90static inline void reiserfs_init_acl_access(struct inode *inode)
91{
92}
93
94static inline void reiserfs_init_acl_default(struct inode *inode)
95{
96}
97#endif 80#endif
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 76360b36ac33..89f4d3abbf5a 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -54,10 +54,6 @@ struct reiserfs_inode_info {
54 unsigned int i_trans_id; 54 unsigned int i_trans_id;
55 struct reiserfs_journal_list *i_jl; 55 struct reiserfs_journal_list *i_jl;
56 struct mutex i_mmap; 56 struct mutex i_mmap;
57#ifdef CONFIG_REISERFS_FS_POSIX_ACL
58 struct posix_acl *i_acl_access;
59 struct posix_acl *i_acl_default;
60#endif
61#ifdef CONFIG_REISERFS_FS_XATTR 57#ifdef CONFIG_REISERFS_FS_XATTR
62 struct rw_semaphore i_xattr_sem; 58 struct rw_semaphore i_xattr_sem;
63#endif 59#endif