aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/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/9p/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/9p/acl.c')
-rw-r--r--fs/9p/acl.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index d7211e28c0d..075bc909da1 100644
--- a/fs/9p/acl.c
+++ b/fs/9p/acl.c
@@ -206,30 +206,18 @@ int v9fs_acl_mode(struct inode *dir, mode_t *modep,
206 mode &= ~current_umask(); 206 mode &= ~current_umask();
207 } 207 }
208 if (acl) { 208 if (acl) {
209 struct posix_acl *clone;
210
211 if (S_ISDIR(mode)) 209 if (S_ISDIR(mode))
212 *dpacl = posix_acl_dup(acl); 210 *dpacl = posix_acl_dup(acl);
213 clone = posix_acl_clone(acl, GFP_NOFS); 211 retval = posix_acl_create(&acl, GFP_NOFS, &mode);
214 posix_acl_release(acl); 212 if (retval < 0)
215 if (!clone) 213 return retval;
216 return -ENOMEM;
217
218 retval = posix_acl_create_masq(clone, &mode);
219 if (retval < 0) {
220 posix_acl_release(clone);
221 goto cleanup;
222 }
223 if (retval > 0) 214 if (retval > 0)
224 *pacl = clone; 215 *pacl = acl;
225 else 216 else
226 posix_acl_release(clone); 217 posix_acl_release(acl);
227 } 218 }
228 *modep = mode; 219 *modep = mode;
229 return 0; 220 return 0;
230cleanup:
231 return retval;
232
233} 221}
234 222
235static int v9fs_remote_get_acl(struct dentry *dentry, const char *name, 223static int v9fs_remote_get_acl(struct dentry *dentry, const char *name,