summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/acl.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-23 03:10:32 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-25 14:27:32 -0400
commit826cae2f2b4d726b925f43bc208a571639da4761 (patch)
treeb7f83eecf3bde8c4e455d89c7c535988b3e8bd59 /fs/jffs2/acl.c
parent95203befa8887997f14077d8557e67d78457ee02 (diff)
downloadlinux-826cae2f2b4d726b925f43bc208a571639da4761.tar.gz
linux-826cae2f2b4d726b925f43bc208a571639da4761.tar.bz2
linux-826cae2f2b4d726b925f43bc208a571639da4761.zip
kill boilerplates around posix_acl_create_masq()
new helper: posix_acl_create(&acl, gfp, mode_p). Replaces acl with modified clone, on failure releases acl and replaces with NULL. Returns 0 or -ve on error. All callers of posix_acl_create_masq() switched. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2/acl.c')
-rw-r--r--fs/jffs2/acl.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 71d022d38508..5783ed81171b 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -277,7 +277,7 @@ int jffs2_check_acl(struct inode *inode, int mask)
int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode)
{
- struct posix_acl *acl, *clone;
+ struct posix_acl *acl;
int rc;
cache_no_acl(inode);
@@ -295,18 +295,13 @@ int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode)
if (S_ISDIR(*i_mode))
set_cached_acl(inode, ACL_TYPE_DEFAULT, acl);
- clone = posix_acl_clone(acl, GFP_KERNEL);
- if (!clone)
- return -ENOMEM;
- rc = posix_acl_create_masq(clone, i_mode);
- if (rc < 0) {
- posix_acl_release(clone);
+ rc = posix_acl_create(&acl, GFP_KERNEL, i_mode);
+ if (rc < 0)
return rc;
- }
if (rc > 0)
- set_cached_acl(inode, ACL_TYPE_ACCESS, clone);
+ set_cached_acl(inode, ACL_TYPE_ACCESS, acl);
- posix_acl_release(clone);
+ posix_acl_release(acl);
}
return 0;
}