Commit cfe14677 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

[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: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 068fbb31
...@@ -1127,8 +1127,8 @@ static void init_inode(struct inode *inode, struct path *path) ...@@ -1127,8 +1127,8 @@ static void init_inode(struct inode *inode, struct path *path)
REISERFS_I(inode)->i_prealloc_count = 0; REISERFS_I(inode)->i_prealloc_count = 0;
REISERFS_I(inode)->i_trans_id = 0; REISERFS_I(inode)->i_trans_id = 0;
REISERFS_I(inode)->i_jl = NULL; REISERFS_I(inode)->i_jl = NULL;
REISERFS_I(inode)->i_acl_access = NULL; reiserfs_init_acl_access(inode);
REISERFS_I(inode)->i_acl_default = NULL; reiserfs_init_acl_default(inode);
reiserfs_init_xattr_rwsem(inode); reiserfs_init_xattr_rwsem(inode);
if (stat_data_v1(ih)) { if (stat_data_v1(ih)) {
...@@ -1834,8 +1834,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1834,8 +1834,8 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
REISERFS_I(inode)->i_attrs = REISERFS_I(inode)->i_attrs =
REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK; REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK;
sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode); sd_attrs_to_i_attrs(REISERFS_I(inode)->i_attrs, inode);
REISERFS_I(inode)->i_acl_access = NULL; reiserfs_init_acl_access(inode);
REISERFS_I(inode)->i_acl_default = NULL; reiserfs_init_acl_default(inode);
reiserfs_init_xattr_rwsem(inode); reiserfs_init_xattr_rwsem(inode);
if (old_format_only(sb)) if (old_format_only(sb))
...@@ -1974,11 +1974,13 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1974,11 +1974,13 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
* iput doesn't deadlock in reiserfs_delete_xattrs. The locking * iput doesn't deadlock in reiserfs_delete_xattrs. The locking
* code really needs to be reworked, but this will take care of it * code really needs to be reworked, but this will take care of it
* for now. -jeffm */ * for now. -jeffm */
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) { if (REISERFS_I(dir)->i_acl_default && !IS_ERR(REISERFS_I(dir)->i_acl_default)) {
reiserfs_write_unlock_xattrs(dir->i_sb); reiserfs_write_unlock_xattrs(dir->i_sb);
iput(inode); iput(inode);
reiserfs_write_lock_xattrs(dir->i_sb); reiserfs_write_lock_xattrs(dir->i_sb);
} else } else
#endif
iput(inode); iput(inode);
return err; return err;
} }
......
...@@ -510,8 +510,10 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags) ...@@ -510,8 +510,10 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
SLAB_CTOR_CONSTRUCTOR) { SLAB_CTOR_CONSTRUCTOR) {
INIT_LIST_HEAD(&ei->i_prealloc_list); INIT_LIST_HEAD(&ei->i_prealloc_list);
inode_init_once(&ei->vfs_inode); inode_init_once(&ei->vfs_inode);
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
ei->i_acl_access = NULL; ei->i_acl_access = NULL;
ei->i_acl_default = NULL; ei->i_acl_default = NULL;
#endif
} }
} }
...@@ -560,6 +562,7 @@ static void reiserfs_dirty_inode(struct inode *inode) ...@@ -560,6 +562,7 @@ static void reiserfs_dirty_inode(struct inode *inode)
reiserfs_write_unlock(inode->i_sb); reiserfs_write_unlock(inode->i_sb);
} }
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
static void reiserfs_clear_inode(struct inode *inode) static void reiserfs_clear_inode(struct inode *inode)
{ {
struct posix_acl *acl; struct posix_acl *acl;
...@@ -574,6 +577,9 @@ static void reiserfs_clear_inode(struct inode *inode) ...@@ -574,6 +577,9 @@ static void reiserfs_clear_inode(struct inode *inode)
posix_acl_release(acl); posix_acl_release(acl);
REISERFS_I(inode)->i_acl_default = NULL; REISERFS_I(inode)->i_acl_default = NULL;
} }
#else
#define reiserfs_clear_inode NULL
#endif
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
......
...@@ -56,6 +56,16 @@ extern int reiserfs_xattr_posix_acl_init(void) __init; ...@@ -56,6 +56,16 @@ extern int reiserfs_xattr_posix_acl_init(void) __init;
extern int reiserfs_xattr_posix_acl_exit(void); extern int reiserfs_xattr_posix_acl_exit(void);
extern struct reiserfs_xattr_handler posix_acl_default_handler; extern struct reiserfs_xattr_handler posix_acl_default_handler;
extern struct reiserfs_xattr_handler posix_acl_access_handler; extern struct reiserfs_xattr_handler posix_acl_access_handler;
static inline void reiserfs_init_acl_access(struct inode *inode)
{
REISERFS_I(inode)->i_acl_access = NULL;
}
static inline void reiserfs_init_acl_default(struct inode *inode)
{
REISERFS_I(inode)->i_acl_default = NULL;
}
#else #else
#define reiserfs_cache_default_acl(inode) 0 #define reiserfs_cache_default_acl(inode) 0
...@@ -87,4 +97,11 @@ reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry, ...@@ -87,4 +97,11 @@ reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry,
return 0; return 0;
} }
static inline void reiserfs_init_acl_access(struct inode *inode)
{
}
static inline void reiserfs_init_acl_default(struct inode *inode)
{
}
#endif #endif
...@@ -52,9 +52,10 @@ struct reiserfs_inode_info { ...@@ -52,9 +52,10 @@ struct reiserfs_inode_info {
** flushed */ ** flushed */
unsigned long i_trans_id; unsigned long i_trans_id;
struct reiserfs_journal_list *i_jl; struct reiserfs_journal_list *i_jl;
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
struct posix_acl *i_acl_access; struct posix_acl *i_acl_access;
struct posix_acl *i_acl_default; struct posix_acl *i_acl_default;
#endif
#ifdef CONFIG_REISERFS_FS_XATTR #ifdef CONFIG_REISERFS_FS_XATTR
struct rw_semaphore xattr_sem; struct rw_semaphore xattr_sem;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment