Commit 95203bef authored by Al Viro's avatar Al Viro

generic_acl: no need to clone acl just to push it to set_cached_acl()

In-core acls are copy-on-write, so the reference taken by set_cached_acl() will
do just fine.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent bc26ab5f
...@@ -134,14 +134,8 @@ generic_acl_init(struct inode *inode, struct inode *dir) ...@@ -134,14 +134,8 @@ generic_acl_init(struct inode *inode, struct inode *dir)
if (acl) { if (acl) {
struct posix_acl *clone; struct posix_acl *clone;
if (S_ISDIR(inode->i_mode)) { if (S_ISDIR(inode->i_mode))
clone = posix_acl_clone(acl, GFP_KERNEL); set_cached_acl(inode, ACL_TYPE_DEFAULT, acl);
error = -ENOMEM;
if (!clone)
goto cleanup;
set_cached_acl(inode, ACL_TYPE_DEFAULT, clone);
posix_acl_release(clone);
}
clone = posix_acl_clone(acl, GFP_KERNEL); clone = posix_acl_clone(acl, GFP_KERNEL);
error = -ENOMEM; error = -ENOMEM;
if (!clone) if (!clone)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment