diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-09-29 05:00:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:11 -0400 |
commit | cfe14677f286c9be5d683b88214def8f4b8a6f24 (patch) | |
tree | 038d6cc9d2a1f71a74fa753c0291038f37fb6718 | |
parent | 068fbb315dd1e9dd3418aac39a9cfeabe39c16a6 (diff) |
[PATCH] reiserfs: ifdef ACL stuff from inode
Shrink reiserfs inode more (by 8 bytes) for ACL non-users:
-reiser_inode_cache 344 11
+reiser_inode_cache 336 11
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/reiserfs/inode.c | 10 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 6 | ||||
-rw-r--r-- | include/linux/reiserfs_acl.h | 17 | ||||
-rw-r--r-- | include/linux/reiserfs_fs_i.h | 3 |
4 files changed, 31 insertions, 5 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 78f23f406932..7e5a2f5ebeb0 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -1127,8 +1127,8 @@ static void init_inode(struct inode *inode, struct path *path) | |||
1127 | REISERFS_I(inode)->i_prealloc_count = 0; | 1127 | REISERFS_I(inode)->i_prealloc_count = 0; |
1128 | REISERFS_I(inode)->i_trans_id = 0; | 1128 | REISERFS_I(inode)->i_trans_id = 0; |
1129 | REISERFS_I(inode)->i_jl = NULL; | 1129 | REISERFS_I(inode)->i_jl = NULL; |
1130 | REISERFS_I(inode)->i_acl_access = NULL; | 1130 | reiserfs_init_acl_access(inode); |
1131 | REISERFS_I(inode)->i_acl_default = NULL; | 1131 | reiserfs_init_acl_default(inode); |
1132 | reiserfs_init_xattr_rwsem(inode); | 1132 | reiserfs_init_xattr_rwsem(inode); |
1133 | 1133 | ||
1134 | if (stat_data_v1(ih)) { | 1134 | if (stat_data_v1(ih)) { |
@@ -1834,8 +1834,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1834 | REISERFS_I(inode)->i_attrs = | 1834 | REISERFS_I(inode)->i_attrs = |
1835 | REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK; | 1835 | REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK; |
1836 | sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode); | 1836 | sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode); |
1837 | REISERFS_I(inode)->i_acl_access = NULL; | 1837 | reiserfs_init_acl_access(inode); |
1838 | REISERFS_I(inode)->i_acl_default = NULL; | 1838 | reiserfs_init_acl_default(inode); |
1839 | reiserfs_init_xattr_rwsem(inode); | 1839 | reiserfs_init_xattr_rwsem(inode); |
1840 | 1840 | ||
1841 | if (old_format_only(sb)) | 1841 | if (old_format_only(sb)) |
@@ -1974,11 +1974,13 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1974 | * iput doesn't deadlock in reiserfs_delete_xattrs. The locking | 1974 | * iput doesn't deadlock in reiserfs_delete_xattrs. The locking |
1975 | * code really needs to be reworked, but this will take care of it | 1975 | * code really needs to be reworked, but this will take care of it |
1976 | * for now. -jeffm */ | 1976 | * for now. -jeffm */ |
1977 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | ||
1977 | if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) { | 1978 | if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) { |
1978 | reiserfs_write_unlock_xattrs(dir->i_sb); | 1979 | reiserfs_write_unlock_xattrs(dir->i_sb); |
1979 | iput(inode); | 1980 | iput(inode); |
1980 | reiserfs_write_lock_xattrs(dir->i_sb); | 1981 | reiserfs_write_lock_xattrs(dir->i_sb); |
1981 | } else | 1982 | } else |
1983 | #endif | ||
1982 | iput(inode); | 1984 | iput(inode); |
1983 | return err; | 1985 | return err; |
1984 | } | 1986 | } |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index b40d4d64d598..80fc3b32802f 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -510,8 +510,10 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags) | |||
510 | SLAB_CTOR_CONSTRUCTOR) { | 510 | SLAB_CTOR_CONSTRUCTOR) { |
511 | INIT_LIST_HEAD(&ei->i_prealloc_list); | 511 | INIT_LIST_HEAD(&ei->i_prealloc_list); |
512 | inode_init_once(&ei->vfs_inode); | 512 | inode_init_once(&ei->vfs_inode); |
513 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | ||
513 | ei->i_acl_access = NULL; | 514 | ei->i_acl_access = NULL; |
514 | ei->i_acl_default = NULL; | 515 | ei->i_acl_default = NULL; |
516 | #endif | ||
515 | } | 517 | } |
516 | } | 518 | } |
517 | 519 | ||
@@ -560,6 +562,7 @@ static void reiserfs_dirty_inode(struct inode *inode) | |||
560 | reiserfs_write_unlock(inode->i_sb); | 562 | reiserfs_write_unlock(inode->i_sb); |
561 | } | 563 | } |
562 | 564 | ||
565 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | ||
563 | static void reiserfs_clear_inode(struct inode *inode) | 566 | static void reiserfs_clear_inode(struct inode *inode) |
564 | { | 567 | { |
565 | struct posix_acl *acl; | 568 | struct posix_acl *acl; |
@@ -574,6 +577,9 @@ static void reiserfs_clear_inode(struct inode *inode) | |||
574 | posix_acl_release(acl); | 577 | posix_acl_release(acl); |
575 | REISERFS_I(inode)->i_acl_default = NULL; | 578 | REISERFS_I(inode)->i_acl_default = NULL; |
576 | } | 579 | } |
580 | #else | ||
581 | #define reiserfs_clear_inode NULL | ||
582 | #endif | ||
577 | 583 | ||
578 | #ifdef CONFIG_QUOTA | 584 | #ifdef CONFIG_QUOTA |
579 | static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, | 585 | static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, |
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 806ec5b06707..fe00f781a622 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
@@ -56,6 +56,16 @@ extern int reiserfs_xattr_posix_acl_init(void) __init; | |||
56 | extern int reiserfs_xattr_posix_acl_exit(void); | 56 | extern int reiserfs_xattr_posix_acl_exit(void); |
57 | extern struct reiserfs_xattr_handler posix_acl_default_handler; | 57 | extern struct reiserfs_xattr_handler posix_acl_default_handler; |
58 | extern struct reiserfs_xattr_handler posix_acl_access_handler; | 58 | extern struct reiserfs_xattr_handler posix_acl_access_handler; |
59 | |||
60 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
61 | { | ||
62 | REISERFS_I(inode)->i_acl_access = NULL; | ||
63 | } | ||
64 | |||
65 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
66 | { | ||
67 | REISERFS_I(inode)->i_acl_default = NULL; | ||
68 | } | ||
59 | #else | 69 | #else |
60 | 70 | ||
61 | #define reiserfs_cache_default_acl(inode) 0 | 71 | #define reiserfs_cache_default_acl(inode) 0 |
@@ -87,4 +97,11 @@ reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry, | |||
87 | return 0; | 97 | return 0; |
88 | } | 98 | } |
89 | 99 | ||
100 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
105 | { | ||
106 | } | ||
90 | #endif | 107 | #endif |
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index 711e7e7cafa5..5b3b297aa2c5 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h | |||
@@ -52,9 +52,10 @@ struct reiserfs_inode_info { | |||
52 | ** flushed */ | 52 | ** flushed */ |
53 | unsigned long i_trans_id; | 53 | unsigned long i_trans_id; |
54 | struct reiserfs_journal_list *i_jl; | 54 | struct reiserfs_journal_list *i_jl; |
55 | 55 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | |
56 | struct posix_acl *i_acl_access; | 56 | struct posix_acl *i_acl_access; |
57 | struct posix_acl *i_acl_default; | 57 | struct posix_acl *i_acl_default; |
58 | #endif | ||
58 | #ifdef CONFIG_REISERFS_FS_XATTR | 59 | #ifdef CONFIG_REISERFS_FS_XATTR |
59 | struct rw_semaphore xattr_sem; | 60 | struct rw_semaphore xattr_sem; |
60 | #endif | 61 | #endif |