aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/acl.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-23 00:18:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-25 14:27:30 -0400
commitbc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (patch)
tree85bbc4e0da4fac99ccf31b3609c61e2b148a8498 /fs/jffs2/acl.c
parent4482a087d4c5a6ffbc385c56b4a4e2f694d9fd5d (diff)
kill boilerplate around posix_acl_chmod_masq()
new helper: posix_acl_chmod(&acl, gfp, mode). Replaces acl with modified clone or with NULL if that has failed; returns 0 or -ve on error. All callers of posix_acl_chmod_masq() switched to that - they'd been doing exactly the same thing. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2/acl.c')
-rw-r--r--fs/jffs2/acl.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 4933a8f8ecc9..71d022d38508 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -332,7 +332,7 @@ int jffs2_init_acl_post(struct inode *inode)
332 332
333int jffs2_acl_chmod(struct inode *inode) 333int jffs2_acl_chmod(struct inode *inode)
334{ 334{
335 struct posix_acl *acl, *clone; 335 struct posix_acl *acl;
336 int rc; 336 int rc;
337 337
338 if (S_ISLNK(inode->i_mode)) 338 if (S_ISLNK(inode->i_mode))
@@ -340,14 +340,11 @@ int jffs2_acl_chmod(struct inode *inode)
340 acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS); 340 acl = jffs2_get_acl(inode, ACL_TYPE_ACCESS);
341 if (IS_ERR(acl) || !acl) 341 if (IS_ERR(acl) || !acl)
342 return PTR_ERR(acl); 342 return PTR_ERR(acl);
343 clone = posix_acl_clone(acl, GFP_KERNEL); 343 rc = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
344 if (rc)
345 return rc;
346 rc = jffs2_set_acl(inode, ACL_TYPE_ACCESS, acl);
344 posix_acl_release(acl); 347 posix_acl_release(acl);
345 if (!clone)
346 return -ENOMEM;
347 rc = posix_acl_chmod_masq(clone, inode->i_mode);
348 if (!rc)
349 rc = jffs2_set_acl(inode, ACL_TYPE_ACCESS, clone);
350 posix_acl_release(clone);
351 return rc; 348 return rc;
352} 349}
353 350