You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -386,3 +386,21 @@ posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, mode_t mode)
|
||||
{
|
||||
struct posix_acl *clone = posix_acl_clone(*acl, gfp);
|
||||
int err = -ENOMEM;
|
||||
if (clone) {
|
||||
err = posix_acl_chmod_masq(clone, mode);
|
||||
if (err) {
|
||||
posix_acl_release(clone);
|
||||
clone = NULL;
|
||||
}
|
||||
}
|
||||
posix_acl_release(*acl);
|
||||
*acl = clone;
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(posix_acl_chmod);
|
||||
|
||||
Reference in New Issue
Block a user