diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 03:10:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:27:32 -0400 |
commit | 826cae2f2b4d726b925f43bc208a571639da4761 (patch) | |
tree | b7f83eecf3bde8c4e455d89c7c535988b3e8bd59 /fs/nfs | |
parent | 95203befa8887997f14077d8557e67d78457ee02 (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/nfs')
-rw-r--r-- | fs/nfs/nfs3acl.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 274342771655..e49e73107e62 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -427,16 +427,12 @@ int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | |||
427 | } | 427 | } |
428 | if (!dfacl) | 428 | if (!dfacl) |
429 | return 0; | 429 | return 0; |
430 | acl = posix_acl_clone(dfacl, GFP_KERNEL); | 430 | acl = posix_acl_dup(dfacl); |
431 | error = -ENOMEM; | 431 | error = posix_acl_create(&acl, GFP_KERNEL, &mode); |
432 | if (!acl) | ||
433 | goto out_release_dfacl; | ||
434 | error = posix_acl_create_masq(acl, &mode); | ||
435 | if (error < 0) | 432 | if (error < 0) |
436 | goto out_release_acl; | 433 | goto out_release_dfacl; |
437 | error = nfs3_proc_setacls(inode, acl, S_ISDIR(inode->i_mode) ? | 434 | error = nfs3_proc_setacls(inode, acl, S_ISDIR(inode->i_mode) ? |
438 | dfacl : NULL); | 435 | dfacl : NULL); |
439 | out_release_acl: | ||
440 | posix_acl_release(acl); | 436 | posix_acl_release(acl); |
441 | out_release_dfacl: | 437 | out_release_dfacl: |
442 | posix_acl_release(dfacl); | 438 | posix_acl_release(dfacl); |