Skip to content

Commit 5e78b43

Browse files
author
Al Viro
committed
switch ext2 to inode->i_acl
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent f19d4a8 commit 5e78b43

5 files changed

Lines changed: 11 additions & 41 deletions

File tree

‎fs/ext2/acl.c‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ ext2_acl_to_disk(const struct posix_acl *acl, size_t *size)
128128
static inline struct posix_acl *
129129
ext2_iget_acl(struct inode *inode, struct posix_acl **i_acl)
130130
{
131-
struct posix_acl *acl = EXT2_ACL_NOT_CACHED;
131+
struct posix_acl *acl = ACL_NOT_CACHED;
132132

133133
spin_lock(&inode->i_lock);
134-
if (*i_acl != EXT2_ACL_NOT_CACHED)
134+
if (*i_acl != ACL_NOT_CACHED)
135135
acl = posix_acl_dup(*i_acl);
136136
spin_unlock(&inode->i_lock);
137137

@@ -143,7 +143,7 @@ ext2_iset_acl(struct inode *inode, struct posix_acl **i_acl,
143143
struct posix_acl *acl)
144144
{
145145
spin_lock(&inode->i_lock);
146-
if (*i_acl != EXT2_ACL_NOT_CACHED)
146+
if (*i_acl != ACL_NOT_CACHED)
147147
posix_acl_release(*i_acl);
148148
*i_acl = posix_acl_dup(acl);
149149
spin_unlock(&inode->i_lock);
@@ -155,7 +155,6 @@ ext2_iset_acl(struct inode *inode, struct posix_acl **i_acl,
155155
static struct posix_acl *
156156
ext2_get_acl(struct inode *inode, int type)
157157
{
158-
struct ext2_inode_info *ei = EXT2_I(inode);
159158
int name_index;
160159
char *value = NULL;
161160
struct posix_acl *acl;
@@ -166,15 +165,15 @@ ext2_get_acl(struct inode *inode, int type)
166165

167166
switch(type) {
168167
case ACL_TYPE_ACCESS:
169-
acl = ext2_iget_acl(inode, &ei->i_acl);
170-
if (acl != EXT2_ACL_NOT_CACHED)
168+
acl = ext2_iget_acl(inode, &inode->i_acl);
169+
if (acl != ACL_NOT_CACHED)
171170
return acl;
172171
name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
173172
break;
174173

175174
case ACL_TYPE_DEFAULT:
176-
acl = ext2_iget_acl(inode, &ei->i_default_acl);
177-
if (acl != EXT2_ACL_NOT_CACHED)
175+
acl = ext2_iget_acl(inode, &inode->i_default_acl);
176+
if (acl != ACL_NOT_CACHED)
178177
return acl;
179178
name_index = EXT2_XATTR_INDEX_POSIX_ACL_DEFAULT;
180179
break;
@@ -200,11 +199,11 @@ ext2_get_acl(struct inode *inode, int type)
200199
if (!IS_ERR(acl)) {
201200
switch(type) {
202201
case ACL_TYPE_ACCESS:
203-
ext2_iset_acl(inode, &ei->i_acl, acl);
202+
ext2_iset_acl(inode, &inode->i_acl, acl);
204203
break;
205204

206205
case ACL_TYPE_DEFAULT:
207-
ext2_iset_acl(inode, &ei->i_default_acl, acl);
206+
ext2_iset_acl(inode, &inode->i_default_acl, acl);
208207
break;
209208
}
210209
}
@@ -217,7 +216,6 @@ ext2_get_acl(struct inode *inode, int type)
217216
static int
218217
ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
219218
{
220-
struct ext2_inode_info *ei = EXT2_I(inode);
221219
int name_index;
222220
void *value = NULL;
223221
size_t size = 0;
@@ -266,11 +264,11 @@ ext2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
266264
if (!error) {
267265
switch(type) {
268266
case ACL_TYPE_ACCESS:
269-
ext2_iset_acl(inode, &ei->i_acl, acl);
267+
ext2_iset_acl(inode, &inode->i_acl, acl);
270268
break;
271269

272270
case ACL_TYPE_DEFAULT:
273-
ext2_iset_acl(inode, &ei->i_default_acl, acl);
271+
ext2_iset_acl(inode, &inode->i_default_acl, acl);
274272
break;
275273
}
276274
}

‎fs/ext2/acl.h‎

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

5454
#ifdef CONFIG_EXT2_FS_POSIX_ACL
5555

56-
/* Value for inode->u.ext2_i.i_acl and inode->u.ext2_i.i_default_acl
57-
if the ACL has not been cached */
58-
#define EXT2_ACL_NOT_CACHED ((void *)-1)
59-
6056
/* acl.c */
6157
extern int ext2_permission (struct inode *, int);
6258
extern int ext2_acl_chmod (struct inode *);

‎fs/ext2/ext2.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ struct ext2_inode_info {
4646
* EAs.
4747
*/
4848
struct rw_semaphore xattr_sem;
49-
#endif
50-
#ifdef CONFIG_EXT2_FS_POSIX_ACL
51-
struct posix_acl *i_acl;
52-
struct posix_acl *i_default_acl;
5349
#endif
5450
rwlock_t i_meta_lock;
5551

‎fs/ext2/inode.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,10 +1224,6 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
12241224
return inode;
12251225

12261226
ei = EXT2_I(inode);
1227-
#ifdef CONFIG_EXT2_FS_POSIX_ACL
1228-
ei->i_acl = EXT2_ACL_NOT_CACHED;
1229-
ei->i_default_acl = EXT2_ACL_NOT_CACHED;
1230-
#endif
12311227
ei->i_block_alloc_info = NULL;
12321228

12331229
raw_inode = ext2_get_inode(inode->i_sb, ino, &bh);

‎fs/ext2/super.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ static struct inode *ext2_alloc_inode(struct super_block *sb)
152152
ei = (struct ext2_inode_info *)kmem_cache_alloc(ext2_inode_cachep, GFP_KERNEL);
153153
if (!ei)
154154
return NULL;
155-
#ifdef CONFIG_EXT2_FS_POSIX_ACL
156-
ei->i_acl = EXT2_ACL_NOT_CACHED;
157-
ei->i_default_acl = EXT2_ACL_NOT_CACHED;
158-
#endif
159155
ei->i_block_alloc_info = NULL;
160156
ei->vfs_inode.i_version = 1;
161157
return &ei->vfs_inode;
@@ -198,18 +194,6 @@ static void destroy_inodecache(void)
198194
static void ext2_clear_inode(struct inode *inode)
199195
{
200196
struct ext2_block_alloc_info *rsv = EXT2_I(inode)->i_block_alloc_info;
201-
#ifdef CONFIG_EXT2_FS_POSIX_ACL
202-
struct ext2_inode_info *ei = EXT2_I(inode);
203-
204-
if (ei->i_acl && ei->i_acl != EXT2_ACL_NOT_CACHED) {
205-
posix_acl_release(ei->i_acl);
206-
ei->i_acl = EXT2_ACL_NOT_CACHED;
207-
}
208-
if (ei->i_default_acl && ei->i_default_acl != EXT2_ACL_NOT_CACHED) {
209-
posix_acl_release(ei->i_default_acl);
210-
ei->i_default_acl = EXT2_ACL_NOT_CACHED;
211-
}
212-
#endif
213197
ext2_discard_reservation(inode);
214198
EXT2_I(inode)->i_block_alloc_info = NULL;
215199
if (unlikely(rsv))

0 commit comments

Comments
 (0)