提交 d4bfe2f7 编写于 作者: A Al Viro

switch ext4 to inode->i_acl

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 6582a0e6
...@@ -134,7 +134,7 @@ ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl) ...@@ -134,7 +134,7 @@ ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl)
if (acl) { if (acl) {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
acl = *i_acl; acl = *i_acl;
if (acl != EXT4_ACL_NOT_CACHED) if (acl != ACL_NOT_CACHED)
acl = posix_acl_dup(acl); acl = posix_acl_dup(acl);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
} }
...@@ -147,7 +147,7 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl, ...@@ -147,7 +147,7 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl,
struct posix_acl *acl) struct posix_acl *acl)
{ {
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
if (*i_acl != EXT4_ACL_NOT_CACHED) if (*i_acl != ACL_NOT_CACHED)
posix_acl_release(*i_acl); posix_acl_release(*i_acl);
*i_acl = posix_acl_dup(acl); *i_acl = posix_acl_dup(acl);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
...@@ -161,7 +161,6 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl, ...@@ -161,7 +161,6 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl,
static struct posix_acl * static struct posix_acl *
ext4_get_acl(struct inode *inode, int type) ext4_get_acl(struct inode *inode, int type)
{ {
struct ext4_inode_info *ei = EXT4_I(inode);
int name_index; int name_index;
char *value = NULL; char *value = NULL;
struct posix_acl *acl; struct posix_acl *acl;
...@@ -172,15 +171,15 @@ ext4_get_acl(struct inode *inode, int type) ...@@ -172,15 +171,15 @@ ext4_get_acl(struct inode *inode, int type)
switch (type) { switch (type) {
case ACL_TYPE_ACCESS: case ACL_TYPE_ACCESS:
acl = ext4_iget_acl(inode, &ei->i_acl); acl = ext4_iget_acl(inode, &inode->i_acl);
if (acl != EXT4_ACL_NOT_CACHED) if (acl != ACL_NOT_CACHED)
return acl; return acl;
name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
break; break;
case ACL_TYPE_DEFAULT: case ACL_TYPE_DEFAULT:
acl = ext4_iget_acl(inode, &ei->i_default_acl); acl = ext4_iget_acl(inode, &inode->i_default_acl);
if (acl != EXT4_ACL_NOT_CACHED) if (acl != ACL_NOT_CACHED)
return acl; return acl;
name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT; name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT;
break; break;
...@@ -206,11 +205,11 @@ ext4_get_acl(struct inode *inode, int type) ...@@ -206,11 +205,11 @@ ext4_get_acl(struct inode *inode, int type)
if (!IS_ERR(acl)) { if (!IS_ERR(acl)) {
switch (type) { switch (type) {
case ACL_TYPE_ACCESS: case ACL_TYPE_ACCESS:
ext4_iset_acl(inode, &ei->i_acl, acl); ext4_iset_acl(inode, &inode->i_acl, acl);
break; break;
case ACL_TYPE_DEFAULT: case ACL_TYPE_DEFAULT:
ext4_iset_acl(inode, &ei->i_default_acl, acl); ext4_iset_acl(inode, &inode->i_default_acl, acl);
break; break;
} }
} }
...@@ -226,7 +225,6 @@ static int ...@@ -226,7 +225,6 @@ static int
ext4_set_acl(handle_t *handle, struct inode *inode, int type, ext4_set_acl(handle_t *handle, struct inode *inode, int type,
struct posix_acl *acl) struct posix_acl *acl)
{ {
struct ext4_inode_info *ei = EXT4_I(inode);
int name_index; int name_index;
void *value = NULL; void *value = NULL;
size_t size = 0; size_t size = 0;
...@@ -274,11 +272,11 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type, ...@@ -274,11 +272,11 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
if (!error) { if (!error) {
switch (type) { switch (type) {
case ACL_TYPE_ACCESS: case ACL_TYPE_ACCESS:
ext4_iset_acl(inode, &ei->i_acl, acl); ext4_iset_acl(inode, &inode->i_acl, acl);
break; break;
case ACL_TYPE_DEFAULT: case ACL_TYPE_DEFAULT:
ext4_iset_acl(inode, &ei->i_default_acl, acl); ext4_iset_acl(inode, &inode->i_default_acl, acl);
break; break;
} }
} }
......
...@@ -53,10 +53,6 @@ static inline int ext4_acl_count(size_t size) ...@@ -53,10 +53,6 @@ static inline int ext4_acl_count(size_t size)
#ifdef CONFIG_EXT4_FS_POSIX_ACL #ifdef CONFIG_EXT4_FS_POSIX_ACL
/* Value for inode->u.ext4_i.i_acl and inode->u.ext4_i.i_default_acl
if the ACL has not been cached */
#define EXT4_ACL_NOT_CACHED ((void *)-1)
/* acl.c */ /* acl.c */
extern int ext4_permission(struct inode *, int); extern int ext4_permission(struct inode *, int);
extern int ext4_acl_chmod(struct inode *); extern int ext4_acl_chmod(struct inode *);
......
...@@ -595,10 +595,6 @@ struct ext4_inode_info { ...@@ -595,10 +595,6 @@ struct ext4_inode_info {
*/ */
struct rw_semaphore xattr_sem; struct rw_semaphore xattr_sem;
#endif #endif
#ifdef CONFIG_EXT4_FS_POSIX_ACL
struct posix_acl *i_acl;
struct posix_acl *i_default_acl;
#endif
struct list_head i_orphan; /* unlinked but open inodes */ struct list_head i_orphan; /* unlinked but open inodes */
......
...@@ -4453,10 +4453,6 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) ...@@ -4453,10 +4453,6 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
return inode; return inode;
ei = EXT4_I(inode); ei = EXT4_I(inode);
#ifdef CONFIG_EXT4_FS_POSIX_ACL
ei->i_acl = EXT4_ACL_NOT_CACHED;
ei->i_default_acl = EXT4_ACL_NOT_CACHED;
#endif
ret = __ext4_get_inode_loc(inode, &iloc, 0); ret = __ext4_get_inode_loc(inode, &iloc, 0);
if (ret < 0) if (ret < 0)
......
...@@ -666,10 +666,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) ...@@ -666,10 +666,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
if (!ei) if (!ei)
return NULL; return NULL;
#ifdef CONFIG_EXT4_FS_POSIX_ACL
ei->i_acl = EXT4_ACL_NOT_CACHED;
ei->i_default_acl = EXT4_ACL_NOT_CACHED;
#endif
ei->vfs_inode.i_version = 1; ei->vfs_inode.i_version = 1;
ei->vfs_inode.i_data.writeback_index = 0; ei->vfs_inode.i_data.writeback_index = 0;
memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache)); memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
...@@ -735,18 +731,6 @@ static void destroy_inodecache(void) ...@@ -735,18 +731,6 @@ static void destroy_inodecache(void)
static void ext4_clear_inode(struct inode *inode) static void ext4_clear_inode(struct inode *inode)
{ {
#ifdef CONFIG_EXT4_FS_POSIX_ACL
if (EXT4_I(inode)->i_acl &&
EXT4_I(inode)->i_acl != EXT4_ACL_NOT_CACHED) {
posix_acl_release(EXT4_I(inode)->i_acl);
EXT4_I(inode)->i_acl = EXT4_ACL_NOT_CACHED;
}
if (EXT4_I(inode)->i_default_acl &&
EXT4_I(inode)->i_default_acl != EXT4_ACL_NOT_CACHED) {
posix_acl_release(EXT4_I(inode)->i_default_acl);
EXT4_I(inode)->i_default_acl = EXT4_ACL_NOT_CACHED;
}
#endif
ext4_discard_preallocations(inode); ext4_discard_preallocations(inode);
if (EXT4_JOURNAL(inode)) if (EXT4_JOURNAL(inode))
jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册