diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 00:18:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:27:30 -0400 |
commit | bc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (patch) | |
tree | 85bbc4e0da4fac99ccf31b3609c61e2b148a8498 /fs/posix_acl.c | |
parent | 4482a087d4c5a6ffbc385c56b4a4e2f694d9fd5d (diff) |
kill boilerplate around posix_acl_chmod_masq()
new helper: posix_acl_chmod(&acl, gfp, mode). Replaces acl with modified
clone or with NULL if that has failed; returns 0 or -ve on error. All
callers of posix_acl_chmod_masq() switched to that - they'd been doing
exactly the same thing.
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 b1cf6bf4b41..0aa9f167672 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -386,3 +386,21 @@ posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) | |||
386 | 386 | ||
387 | return 0; | 387 | return 0; |
388 | } | 388 | } |
389 | |||
390 | int | ||
391 | posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, mode_t mode) | ||
392 | { | ||
393 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); | ||
394 | int err = -ENOMEM; | ||
395 | if (clone) { | ||
396 | err = posix_acl_chmod_masq(clone, mode); | ||
397 | if (err) { | ||
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_chmod); | ||