Skip to content

Commit d4bfe2f

Browse files
author
Al Viro
committed
switch ext4 to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 6582a0e commit d4bfe2f

5 files changed

Lines changed: 10 additions & 40 deletions

File tree

‎fs/ext4/acl.c‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl)
134134
if (acl) {
135135
spin_lock(&inode->i_lock);
136136
acl = *i_acl;
137-
if (acl != EXT4_ACL_NOT_CACHED)
137+
if (acl != ACL_NOT_CACHED)
138138
acl = posix_acl_dup(acl);
139139
spin_unlock(&inode->i_lock);
140140
}
@@ -147,7 +147,7 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl,
147147
struct posix_acl *acl)
148148
{
149149
spin_lock(&inode->i_lock);
150-
if (*i_acl != EXT4_ACL_NOT_CACHED)
150+
if (*i_acl != ACL_NOT_CACHED)
151151
posix_acl_release(*i_acl);
152152
*i_acl = posix_acl_dup(acl);
153153
spin_unlock(&inode->i_lock);
@@ -161,7 +161,6 @@ ext4_iset_acl(struct inode *inode, struct posix_acl **i_acl,
161161
static struct posix_acl *
162162
ext4_get_acl(struct inode *inode, int type)
163163
{
164-
struct ext4_inode_info *ei = EXT4_I(inode);
165164
int name_index;
166165
char *value = NULL;
167166
struct posix_acl *acl;
@@ -172,15 +171,15 @@ ext4_get_acl(struct inode *inode, int type)
172171

173172
switch (type) {
174173
case ACL_TYPE_ACCESS:
175-
acl = ext4_iget_acl(inode, &ei->i_acl);
176-
if (acl != EXT4_ACL_NOT_CACHED)
174+
acl = ext4_iget_acl(inode, &inode->i_acl);
175+
if (acl != ACL_NOT_CACHED)
177176
return acl;
178177
name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
179178
break;
180179

181180
case ACL_TYPE_DEFAULT:
182-
acl = ext4_iget_acl(inode, &ei->i_default_acl);
183-
if (acl != EXT4_ACL_NOT_CACHED)
181+
acl = ext4_iget_acl(inode, &inode->i_default_acl);
182+
if (acl != ACL_NOT_CACHED)
184183
return acl;
185184
name_index = EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT;
186185
break;
@@ -206,11 +205,11 @@ ext4_get_acl(struct inode *inode, int type)
206205
if (!IS_ERR(acl)) {
207206
switch (type) {
208207
case ACL_TYPE_ACCESS:
209-
ext4_iset_acl(inode, &ei->i_acl, acl);
208+
ext4_iset_acl(inode, &inode->i_acl, acl);
210209
break;
211210

212211
case ACL_TYPE_DEFAULT:
213-
ext4_iset_acl(inode, &ei->i_default_acl, acl);
212+
ext4_iset_acl(inode, &inode->i_default_acl, acl);
214213
break;
215214
}
216215
}
@@ -226,7 +225,6 @@ static int
226225
ext4_set_acl(handle_t *handle, struct inode *inode, int type,
227226
struct posix_acl *acl)
228227
{
229-
struct ext4_inode_info *ei = EXT4_I(inode);
230228
int name_index;
231229
void *value = NULL;
232230
size_t size = 0;
@@ -274,11 +272,11 @@ ext4_set_acl(handle_t *handle, struct inode *inode, int type,
274272
if (!error) {
275273
switch (type) {
276274
case ACL_TYPE_ACCESS:
277-
ext4_iset_acl(inode, &ei->i_acl, acl);
275+
ext4_iset_acl(inode, &inode->i_acl, acl);
278276
break;
279277

280278
case ACL_TYPE_DEFAULT:
281-
ext4_iset_acl(inode, &ei->i_default_acl, acl);
279+
ext4_iset_acl(inode, &inode->i_default_acl, acl);
282280
break;
283281
}
284282
}

‎fs/ext4/acl.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ static inline int ext4_acl_count(size_t size)
5353

5454
#ifdef CONFIG_EXT4_FS_POSIX_ACL
5555

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-
6056
/* acl.c */
6157
extern int ext4_permission(struct inode *, int);
6258
extern int ext4_acl_chmod(struct inode *);

‎fs/ext4/ext4.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,10 +595,6 @@ struct ext4_inode_info {
595595
*/
596596
struct rw_semaphore xattr_sem;
597597
#endif
598-
#ifdef CONFIG_EXT4_FS_POSIX_ACL
599-
struct posix_acl *i_acl;
600-
struct posix_acl *i_default_acl;
601-
#endif
602598

603599
struct list_head i_orphan; /* unlinked but open inodes */
604600

‎fs/ext4/inode.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4453,10 +4453,6 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
44534453
return inode;
44544454

44554455
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
44604456

44614457
ret = __ext4_get_inode_loc(inode, &iloc, 0);
44624458
if (ret < 0)

‎fs/ext4/super.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
666666
if (!ei)
667667
return NULL;
668668

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
673669
ei->vfs_inode.i_version = 1;
674670
ei->vfs_inode.i_data.writeback_index = 0;
675671
memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
@@ -735,18 +731,6 @@ static void destroy_inodecache(void)
735731

736732
static void ext4_clear_inode(struct inode *inode)
737733
{
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
750734
ext4_discard_preallocations(inode);
751735
if (EXT4_JOURNAL(inode))
752736
jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal,

0 commit comments

Comments
 (0)