@@ -158,10 +158,10 @@ static void *jffs2_acl_to_medium(const struct posix_acl *acl, size_t *size)
158158
159159static struct posix_acl * jffs2_iget_acl (struct inode * inode , struct posix_acl * * i_acl )
160160{
161- struct posix_acl * acl = JFFS2_ACL_NOT_CACHED ;
161+ struct posix_acl * acl = ACL_NOT_CACHED ;
162162
163163 spin_lock (& inode -> i_lock );
164- if (* i_acl != JFFS2_ACL_NOT_CACHED )
164+ if (* i_acl != ACL_NOT_CACHED )
165165 acl = posix_acl_dup (* i_acl );
166166 spin_unlock (& inode -> i_lock );
167167 return acl ;
@@ -170,29 +170,28 @@ static struct posix_acl *jffs2_iget_acl(struct inode *inode, struct posix_acl **
170170static void jffs2_iset_acl (struct inode * inode , struct posix_acl * * i_acl , struct posix_acl * acl )
171171{
172172 spin_lock (& inode -> i_lock );
173- if (* i_acl != JFFS2_ACL_NOT_CACHED )
173+ if (* i_acl != ACL_NOT_CACHED )
174174 posix_acl_release (* i_acl );
175175 * i_acl = posix_acl_dup (acl );
176176 spin_unlock (& inode -> i_lock );
177177}
178178
179179static struct posix_acl * jffs2_get_acl (struct inode * inode , int type )
180180{
181- struct jffs2_inode_info * f = JFFS2_INODE_INFO (inode );
182181 struct posix_acl * acl ;
183182 char * value = NULL ;
184183 int rc , xprefix ;
185184
186185 switch (type ) {
187186 case ACL_TYPE_ACCESS :
188- acl = jffs2_iget_acl (inode , & f -> i_acl_access );
189- if (acl != JFFS2_ACL_NOT_CACHED )
187+ acl = jffs2_iget_acl (inode , & inode -> i_acl );
188+ if (acl != ACL_NOT_CACHED )
190189 return acl ;
191190 xprefix = JFFS2_XPREFIX_ACL_ACCESS ;
192191 break ;
193192 case ACL_TYPE_DEFAULT :
194- acl = jffs2_iget_acl (inode , & f -> i_acl_default );
195- if (acl != JFFS2_ACL_NOT_CACHED )
193+ acl = jffs2_iget_acl (inode , & inode -> i_default_acl );
194+ if (acl != ACL_NOT_CACHED )
196195 return acl ;
197196 xprefix = JFFS2_XPREFIX_ACL_DEFAULT ;
198197 break ;
@@ -218,10 +217,10 @@ static struct posix_acl *jffs2_get_acl(struct inode *inode, int type)
218217 if (!IS_ERR (acl )) {
219218 switch (type ) {
220219 case ACL_TYPE_ACCESS :
221- jffs2_iset_acl (inode , & f -> i_acl_access , acl );
220+ jffs2_iset_acl (inode , & inode -> i_acl , acl );
222221 break ;
223222 case ACL_TYPE_DEFAULT :
224- jffs2_iset_acl (inode , & f -> i_acl_default , acl );
223+ jffs2_iset_acl (inode , & inode -> i_default_acl , acl );
225224 break ;
226225 }
227226 }
@@ -249,7 +248,6 @@ static int __jffs2_set_acl(struct inode *inode, int xprefix, struct posix_acl *a
249248
250249static int jffs2_set_acl (struct inode * inode , int type , struct posix_acl * acl )
251250{
252- struct jffs2_inode_info * f = JFFS2_INODE_INFO (inode );
253251 int rc , xprefix ;
254252
255253 if (S_ISLNK (inode -> i_mode ))
@@ -288,10 +286,10 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl)
288286 if (!rc ) {
289287 switch (type ) {
290288 case ACL_TYPE_ACCESS :
291- jffs2_iset_acl (inode , & f -> i_acl_access , acl );
289+ jffs2_iset_acl (inode , & inode -> i_acl , acl );
292290 break ;
293291 case ACL_TYPE_DEFAULT :
294- jffs2_iset_acl (inode , & f -> i_acl_default , acl );
292+ jffs2_iset_acl (inode , & inode -> i_default_acl , acl );
295293 break ;
296294 }
297295 }
@@ -321,12 +319,11 @@ int jffs2_permission(struct inode *inode, int mask)
321319
322320int jffs2_init_acl_pre (struct inode * dir_i , struct inode * inode , int * i_mode )
323321{
324- struct jffs2_inode_info * f = JFFS2_INODE_INFO (inode );
325322 struct posix_acl * acl , * clone ;
326323 int rc ;
327324
328- f -> i_acl_default = NULL ;
329- f -> i_acl_access = NULL ;
325+ inode -> i_default_acl = NULL ;
326+ inode -> i_acl = NULL ;
330327
331328 if (S_ISLNK (* i_mode ))
332329 return 0 ; /* Symlink always has no-ACL */
@@ -339,7 +336,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
339336 * i_mode &= ~current_umask ();
340337 } else {
341338 if (S_ISDIR (* i_mode ))
342- jffs2_iset_acl (inode , & f -> i_acl_default , acl );
339+ jffs2_iset_acl (inode , & inode -> i_default_acl , acl );
343340
344341 clone = posix_acl_clone (acl , GFP_KERNEL );
345342 if (!clone )
@@ -350,7 +347,7 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
350347 return rc ;
351348 }
352349 if (rc > 0 )
353- jffs2_iset_acl (inode , & f -> i_acl_access , clone );
350+ jffs2_iset_acl (inode , & inode -> i_acl , clone );
354351
355352 posix_acl_release (clone );
356353 }
@@ -359,36 +356,23 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, int *i_mode)
359356
360357int jffs2_init_acl_post (struct inode * inode )
361358{
362- struct jffs2_inode_info * f = JFFS2_INODE_INFO (inode );
363359 int rc ;
364360
365- if (f -> i_acl_default ) {
366- rc = __jffs2_set_acl (inode , JFFS2_XPREFIX_ACL_DEFAULT , f -> i_acl_default );
361+ if (inode -> i_default_acl ) {
362+ rc = __jffs2_set_acl (inode , JFFS2_XPREFIX_ACL_DEFAULT , inode -> i_default_acl );
367363 if (rc )
368364 return rc ;
369365 }
370366
371- if (f -> i_acl_access ) {
372- rc = __jffs2_set_acl (inode , JFFS2_XPREFIX_ACL_ACCESS , f -> i_acl_access );
367+ if (inode -> i_acl ) {
368+ rc = __jffs2_set_acl (inode , JFFS2_XPREFIX_ACL_ACCESS , inode -> i_acl );
373369 if (rc )
374370 return rc ;
375371 }
376372
377373 return 0 ;
378374}
379375
380- void jffs2_clear_acl (struct jffs2_inode_info * f )
381- {
382- if (f -> i_acl_access && f -> i_acl_access != JFFS2_ACL_NOT_CACHED ) {
383- posix_acl_release (f -> i_acl_access );
384- f -> i_acl_access = JFFS2_ACL_NOT_CACHED ;
385- }
386- if (f -> i_acl_default && f -> i_acl_default != JFFS2_ACL_NOT_CACHED ) {
387- posix_acl_release (f -> i_acl_default );
388- f -> i_acl_default = JFFS2_ACL_NOT_CACHED ;
389- }
390- }
391-
392376int jffs2_acl_chmod (struct inode * inode )
393377{
394378 struct posix_acl * acl , * clone ;
0 commit comments