diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-08 19:54:26 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 08:17:04 -0400 |
| commit | d4bfe2f76d785cc77611a4bda8cedaff358d8c7d (patch) | |
| tree | a8c953fe752afebadb4f0fb4aa3e80dbab934f7f | |
| parent | 6582a0e6f6bc7bf64817b9e1a424782855292ab0 (diff) | |
switch ext4 to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| -rw-r--r-- | fs/ext4/acl.c | 22 | ||||
| -rw-r--r-- | fs/ext4/acl.h | 4 | ||||
| -rw-r--r-- | fs/ext4/ext4.h | 4 | ||||
| -rw-r--r-- | fs/ext4/inode.c | 4 | ||||
| -rw-r--r-- | fs/ext4/super.c | 16 |
5 files changed, 10 insertions, 40 deletions
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index 605aeed96d68..0084e3a19d86 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c | |||
| @@ -134,7 +134,7 @@ ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl) | |||
| 134 | if (acl) { | 134 | if (acl) { |
| 135 | spin_lock(&inode->i_lock); | 135 | spin_lock(&inode->i_lock); |
| 136 | acl = *i_acl; | 136 | acl = *i_acl; |
| 137 | if (acl != EXT4_ACL_NOT_CACHED) | 137 | if (acl != ACL_NOT_CACHED) |
| 138 | acl = posix_acl_dup(acl); | 138 | acl = posix_acl_dup(acl); |
| 139 | spin_unlock(&inode->i_lock); | 139 | spin_unlock(&inode->i_lock); |
| 140 | } | 140 | } |
| @@ -147,7 +147,7 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl, | |||
| 147 | struct posix_acl *acl) | 147 | struct posix_acl *acl) |
| 148 | { | 148 | { |
| 149 | spin_lock(&inode->i_lock); | 149 | spin_lock(&inode->i_lock); |
| 150 | if (*i_acl != EXT4_ACL_NOT_CACHED) | 150 | if (*i_acl != ACL_NOT_CACHED) |
| 151 | posix_acl_release(*i_acl); | 151 | posix_acl_release(*i_acl); |
| 152 | *i_acl = posix_acl_dup(acl); | 152 | *i_acl = posix_acl_dup(acl); |
| 153 | spin_unlock(&inode->i_lock); | 153 | spin_unlock(&inode->i_lock); |
| @@ -161,7 +161,6 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl, | |||
| 161 | static struct posix_acl * | 161 | static struct posix_acl * |
| 162 | ext4_get_acl(struct inode *inode, int type) | 162 | ext4_get_acl(struct inode *inode, int type) |
| 163 | { | 163 | { |
| 164 | struct ext4_inode_info *ei = EXT4_I(inode); | ||
| 165 | int name_index; | 164 | int name_index; |
| 166 | char *value = NULL; | 165 | char *value = NULL; |
| 167 | struct posix_acl *acl; | 166 | struct posix_acl *acl; |
| @@ -172,15 +171,15 @@ ext4_get_acl(struct inode *inode, int type) | |||
| 172 | 171 | ||
| 173 | switch (type) { | 172 | switch (type) { |
| 174 | case ACL_TYPE_ACCESS: | 173 | case ACL_TYPE_ACCESS: |
| 175 | acl = ext4_iget_acl(inode, &ei->i_acl); | 174 | acl = ext4_iget_acl(inode, &inode->i_acl); |
| 176 | if (acl != EXT4_ACL_NOT_CACHED) | 175 | if (acl != ACL_NOT_CACHED) |
| 177 | return acl; | 176 | return acl; |
| 178 | name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; | 177 | name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; |
| 179 | break; | 178 | break; |
| 180 | 179 | ||
| 181 | case ACL_TYPE_DEFAULT: | 180 | case ACL_TYPE_DEFAULT: |
| 182 | acl = ext4_iget_acl(inode, &ei->i_default_acl); | 181 | acl = ext4_iget_acl(inode, &inode->i_default_acl); |
| 183 | if (acl != EXT4_ACL_NOT_CACHED) | 182 | if (acl != ACL_NOT_CACHED) |
| 184 | return acl; | 183 | return acl; |
| 185 | name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT; | 184 | name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT; |
| 186 | break; | 185 | break; |
| @@ -206,11 +205,11 @@ ext4_get_acl(struct inode *inode, int type) | |||
| 206 | if (!IS_ERR(acl)) { | 205 | if (!IS_ERR(acl)) { |
| 207 | switch (type) { | 206 | switch (type) { |
| 208 | case ACL_TYPE_ACCESS: | 207 | case ACL_TYPE_ACCESS: |
| 209 | ext4_iset_acl(inode, &ei->i_acl, acl); | 208 | ext4_iset_acl(inode, &inode->i_acl, acl); |
| 210 | break; | 209 | break; |
| 211 | 210 | ||
| 212 | case ACL_TYPE_DEFAULT: | 211 | case ACL_TYPE_DEFAULT: |
| 213 | ext4_iset_acl(inode, &ei->i_default_acl, acl); | 212 | ext4_iset_acl(inode, &inode->i_default_acl, acl); |
| 214 | break; | 213 | break; |
| 215 | } | 214 | } |
| 216 | } | 215 | } |
| @@ -226,7 +225,6 @@ static int | |||
| 226 | ext4_set_acl(handle_t *handle, struct inode *inode, int type, | 225 | ext4_set_acl(handle_t *handle, struct inode *inode, int type, |
| 227 | struct posix_acl *acl) | 226 | struct posix_acl *acl) |
| 228 | { | 227 | { |
| 229 | struct ext4_inode_info *ei = EXT4_I(inode); | ||
| 230 | int name_index; | 228 | int name_index; |
| 231 | void *value = NULL; | 229 | void *value = NULL; |
| 232 | size_t size = 0; | 230 | size_t size = 0; |
| @@ -274,11 +272,11 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type, | |||
| 274 | if (!error) { | 272 | if (!error) { |
| 275 | switch (type) { | 273 | switch (type) { |
| 276 | case ACL_TYPE_ACCESS: | 274 | case ACL_TYPE_ACCESS: |
| 277 | ext4_iset_acl(inode, &ei->i_acl, acl); | 275 | ext4_iset_acl(inode, &inode->i_acl, acl); |
| 278 | break; | 276 | break; |
| 279 | 277 | ||
| 280 | case ACL_TYPE_DEFAULT: | 278 | case ACL_TYPE_DEFAULT: |
| 281 | ext4_iset_acl(inode, &ei->i_default_acl, acl); | 279 | ext4_iset_acl(inode, &inode->i_default_acl, acl); |
| 282 | break; | 280 | break; |
| 283 | } | 281 | } |
| 284 | } | 282 | } |
diff --git a/fs/ext4/acl.h b/fs/ext4/acl.h index cb45257a246e..949789d2bba6 100644 --- a/fs/ext4/acl.h +++ b/fs/ext4/acl.h | |||
| @@ -53,10 +53,6 @@ static inline int ext4_acl_count(size_t size) | |||
| 53 | 53 | ||
| 54 | #ifdef CONFIG_EXT4_FS_POSIX_ACL | 54 | #ifdef CONFIG_EXT4_FS_POSIX_ACL |
| 55 | 55 | ||
| 56 | /* Value for inode->u.ext4_i.i_acl and inode->u.ext4_i.i_default_acl | ||
| 57 | if the ACL has not been cached */ | ||
| 58 | #define EXT4_ACL_NOT_CACHED ((void *)-1) | ||
| 59 | |||
| 60 | /* acl.c */ | 56 | /* acl.c */ |
| 61 | extern int ext4_permission(struct inode *, int); | 57 | extern int ext4_permission(struct inode *, int); |
| 62 | extern int ext4_acl_chmod(struct inode *); | 58 | extern int ext4_acl_chmod(struct inode *); |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 17b9998680e3..0ddf7e55abe1 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
| @@ -595,10 +595,6 @@ struct ext4_inode_info { | |||
| 595 | */ | 595 | */ |
| 596 | struct rw_semaphore xattr_sem; | 596 | struct rw_semaphore xattr_sem; |
| 597 | #endif | 597 | #endif |
| 598 | #ifdef CONFIG_EXT4_FS_POSIX_ACL | ||
| 599 | struct posix_acl *i_acl; | ||
| 600 | struct posix_acl *i_default_acl; | ||
| 601 | #endif | ||
| 602 | 598 | ||
| 603 | struct list_head i_orphan; /* unlinked but open inodes */ | 599 | struct list_head i_orphan; /* unlinked but open inodes */ |
| 604 | 600 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 7c17ae275af4..60a26f3a6f8b 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
| @@ -4453,10 +4453,6 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) | |||
| 4453 | return inode; | 4453 | return inode; |
| 4454 | 4454 | ||
| 4455 | ei = EXT4_I(inode); | 4455 | ei = EXT4_I(inode); |
| 4456 | #ifdef CONFIG_EXT4_FS_POSIX_ACL | ||
| 4457 | ei->i_acl = EXT4_ACL_NOT_CACHED; | ||
| 4458 | ei->i_default_acl = EXT4_ACL_NOT_CACHED; | ||
| 4459 | #endif | ||
| 4460 | 4456 | ||
| 4461 | ret = __ext4_get_inode_loc(inode, &iloc, 0); | 4457 | ret = __ext4_get_inode_loc(inode, &iloc, 0); |
| 4462 | if (ret < 0) | 4458 | if (ret < 0) |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 8bb9e2d3e4b8..8f4f079e6b9a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -666,10 +666,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) | |||
| 666 | if (!ei) | 666 | if (!ei) |
| 667 | return NULL; | 667 | return NULL; |
| 668 | 668 | ||
| 669 | #ifdef CONFIG_EXT4_FS_POSIX_ACL | ||
| 670 | ei->i_acl = EXT4_ACL_NOT_CACHED; | ||
| 671 | ei->i_default_acl = EXT4_ACL_NOT_CACHED; | ||
| 672 | #endif | ||
| 673 | ei->vfs_inode.i_version = 1; | 669 | ei->vfs_inode.i_version = 1; |
| 674 | ei->vfs_inode.i_data.writeback_index = 0; | 670 | ei->vfs_inode.i_data.writeback_index = 0; |
| 675 | memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache)); | 671 | memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache)); |
| @@ -735,18 +731,6 @@ static void destroy_inodecache(void) | |||
| 735 | 731 | ||
| 736 | static void ext4_clear_inode(struct inode *inode) | 732 | static void ext4_clear_inode(struct inode *inode) |
| 737 | { | 733 | { |
| 738 | #ifdef CONFIG_EXT4_FS_POSIX_ACL | ||
| 739 | if (EXT4_I(inode)->i_acl && | ||
| 740 | EXT4_I(inode)->i_acl != EXT4_ACL_NOT_CACHED) { | ||
| 741 | posix_acl_release(EXT4_I(inode)->i_acl); | ||
| 742 | EXT4_I(inode)->i_acl = EXT4_ACL_NOT_CACHED; | ||
| 743 | } | ||
| 744 | if (EXT4_I(inode)->i_default_acl && | ||
| 745 | EXT4_I(inode)->i_default_acl != EXT4_ACL_NOT_CACHED) { | ||
| 746 | posix_acl_release(EXT4_I(inode)->i_default_acl); | ||
| 747 | EXT4_I(inode)->i_default_acl = EXT4_ACL_NOT_CACHED; | ||
| 748 | } | ||
| 749 | #endif | ||
| 750 | ext4_discard_preallocations(inode); | 734 | ext4_discard_preallocations(inode); |
| 751 | if (EXT4_JOURNAL(inode)) | 735 | if (EXT4_JOURNAL(inode)) |
| 752 | jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, | 736 | jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, |
