Commit 281eede0 authored by Al Viro's avatar Al Viro

switch reiserfs to inode->i_acl

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7a77b15d
...@@ -1131,8 +1131,6 @@ static void init_inode(struct inode *inode, struct treepath *path) ...@@ -1131,8 +1131,6 @@ static void init_inode(struct inode *inode, struct treepath *path)
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;
mutex_init(&(REISERFS_I(inode)->i_mmap)); mutex_init(&(REISERFS_I(inode)->i_mmap));
reiserfs_init_acl_access(inode);
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 +1832,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1834,8 +1832,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
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);
mutex_init(&(REISERFS_I(inode)->i_mmap)); mutex_init(&(REISERFS_I(inode)->i_mmap));
reiserfs_init_acl_access(inode);
reiserfs_init_acl_default(inode);
reiserfs_init_xattr_rwsem(inode); reiserfs_init_xattr_rwsem(inode);
/* key to search for correct place for new stat data */ /* key to search for correct place for new stat data */
......
...@@ -529,10 +529,6 @@ static void init_once(void *foo) ...@@ -529,10 +529,6 @@ static void init_once(void *foo)
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 = ACL_NOT_CACHED;
ei->i_acl_default = ACL_NOT_CACHED;
#endif
} }
static int init_inodecache(void) static int init_inodecache(void)
...@@ -580,25 +576,6 @@ static void reiserfs_dirty_inode(struct inode *inode) ...@@ -580,25 +576,6 @@ 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)
{
struct posix_acl *acl;
acl = REISERFS_I(inode)->i_acl_access;
if (acl && acl != ACL_NOT_CACHED)
posix_acl_release(acl);
REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
acl = REISERFS_I(inode)->i_acl_default;
if (acl && acl != ACL_NOT_CACHED)
posix_acl_release(acl);
REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
}
#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 *,
size_t, loff_t); size_t, loff_t);
...@@ -612,7 +589,6 @@ static const struct super_operations reiserfs_sops = { ...@@ -612,7 +589,6 @@ static const struct super_operations reiserfs_sops = {
.write_inode = reiserfs_write_inode, .write_inode = reiserfs_write_inode,
.dirty_inode = reiserfs_dirty_inode, .dirty_inode = reiserfs_dirty_inode,
.delete_inode = reiserfs_delete_inode, .delete_inode = reiserfs_delete_inode,
.clear_inode = reiserfs_clear_inode,
.put_super = reiserfs_put_super, .put_super = reiserfs_put_super,
.write_super = reiserfs_write_super, .write_super = reiserfs_write_super,
.sync_fs = reiserfs_sync_fs, .sync_fs = reiserfs_sync_fs,
......
...@@ -223,16 +223,15 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) ...@@ -223,16 +223,15 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
struct posix_acl *acl, **p_acl; struct posix_acl *acl, **p_acl;
int size; int size;
int retval; int retval;
struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode);
switch (type) { switch (type) {
case ACL_TYPE_ACCESS: case ACL_TYPE_ACCESS:
name = POSIX_ACL_XATTR_ACCESS; name = POSIX_ACL_XATTR_ACCESS;
p_acl = &reiserfs_i->i_acl_access; p_acl = &inode->i_acl;
break; break;
case ACL_TYPE_DEFAULT: case ACL_TYPE_DEFAULT:
name = POSIX_ACL_XATTR_DEFAULT; name = POSIX_ACL_XATTR_DEFAULT;
p_acl = &reiserfs_i->i_acl_default; p_acl = &inode->i_default_acl;
break; break;
default: default:
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -288,7 +287,6 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, ...@@ -288,7 +287,6 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
struct posix_acl **p_acl; struct posix_acl **p_acl;
size_t size = 0; size_t size = 0;
int error; int error;
struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode);
if (S_ISLNK(inode->i_mode)) if (S_ISLNK(inode->i_mode))
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -296,7 +294,7 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, ...@@ -296,7 +294,7 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
switch (type) { switch (type) {
case ACL_TYPE_ACCESS: case ACL_TYPE_ACCESS:
name = POSIX_ACL_XATTR_ACCESS; name = POSIX_ACL_XATTR_ACCESS;
p_acl = &reiserfs_i->i_acl_access; p_acl = &inode->i_acl;
if (acl) { if (acl) {
mode_t mode = inode->i_mode; mode_t mode = inode->i_mode;
error = posix_acl_equiv_mode(acl, &mode); error = posix_acl_equiv_mode(acl, &mode);
...@@ -311,7 +309,7 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, ...@@ -311,7 +309,7 @@ reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,
break; break;
case ACL_TYPE_DEFAULT: case ACL_TYPE_DEFAULT:
name = POSIX_ACL_XATTR_DEFAULT; name = POSIX_ACL_XATTR_DEFAULT;
p_acl = &reiserfs_i->i_acl_default; p_acl = &inode->i_default_acl;
if (!S_ISDIR(inode->i_mode)) if (!S_ISDIR(inode->i_mode))
return acl ? -EACCES : 0; return acl ? -EACCES : 0;
break; break;
......
...@@ -56,15 +56,6 @@ int reiserfs_cache_default_acl(struct inode *dir); ...@@ -56,15 +56,6 @@ int reiserfs_cache_default_acl(struct inode *dir);
extern struct xattr_handler reiserfs_posix_acl_default_handler; extern struct xattr_handler reiserfs_posix_acl_default_handler;
extern struct xattr_handler reiserfs_posix_acl_access_handler; extern struct xattr_handler reiserfs_posix_acl_access_handler;
static inline void reiserfs_init_acl_access(struct inode *inode)
{
REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
}
static inline void reiserfs_init_acl_default(struct inode *inode)
{
REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
}
#else #else
#define reiserfs_cache_default_acl(inode) 0 #define reiserfs_cache_default_acl(inode) 0
...@@ -86,12 +77,4 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, ...@@ -86,12 +77,4 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
{ {
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
...@@ -54,10 +54,6 @@ struct reiserfs_inode_info { ...@@ -54,10 +54,6 @@ struct reiserfs_inode_info {
unsigned int i_trans_id; unsigned int i_trans_id;
struct reiserfs_journal_list *i_jl; struct reiserfs_journal_list *i_jl;
struct mutex i_mmap; struct mutex i_mmap;
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
struct posix_acl *i_acl_access;
struct posix_acl *i_acl_default;
#endif
#ifdef CONFIG_REISERFS_FS_XATTR #ifdef CONFIG_REISERFS_FS_XATTR
struct rw_semaphore i_xattr_sem; struct rw_semaphore i_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