aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/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/gfs2/acl.c
parent95203befa8887997f14077d8557e67d78457ee02 (diff)
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/gfs2/acl.c')
-rw-r--r--fs/gfs2/acl.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 160d4e1575ce..a2dd63c0c11a 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -137,7 +137,7 @@ out:
137int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode) 137int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode)
138{ 138{
139 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 139 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
140 struct posix_acl *acl, *clone; 140 struct posix_acl *acl;
141 mode_t mode = inode->i_mode; 141 mode_t mode = inode->i_mode;
142 int error = 0; 142 int error = 0;
143 143
@@ -162,16 +162,10 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode)
162 goto out; 162 goto out;
163 } 163 }
164 164
165 clone = posix_acl_clone(acl, GFP_NOFS); 165 error = posix_acl_create(&acl, GFP_NOFS, &mode);
166 error = -ENOMEM;
167 if (!clone)
168 goto out;
169 posix_acl_release(acl);
170 acl = clone;
171
172 error = posix_acl_create_masq(acl, &mode);
173 if (error < 0) 166 if (error < 0)
174 goto out; 167 return error;
168
175 if (error == 0) 169 if (error == 0)
176 goto munge; 170 goto munge;
177 171