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/posix_acl.c | |
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/posix_acl.c')
-rw-r--r-- | fs/posix_acl.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 0aa9f1676726..365a0712da6a 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -388,6 +388,24 @@ posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) | |||
388 | } | 388 | } |
389 | 389 | ||
390 | int | 390 | int |
391 | posix_acl_create(struct posix_acl **acl, gfp_t gfp, mode_t *mode_p) | ||
392 | { | ||
393 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); | ||
394 | int err = -ENOMEM; | ||
395 | if (clone) { | ||
396 | err = posix_acl_create_masq(clone, mode_p); | ||
397 | if (err < 0) { | ||
398 | posix_acl_release(clone); | ||
399 | clone = NULL; | ||
400 | } | ||
401 | } | ||
402 | posix_acl_release(*acl); | ||
403 | *acl = clone; | ||
404 | return err; | ||
405 | } | ||
406 | EXPORT_SYMBOL(posix_acl_create); | ||
407 | |||
408 | int | ||
391 | posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, mode_t mode) | 409 | posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, mode_t mode) |
392 | { | 410 | { |
393 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); | 411 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); |