Skip to content

Commit

Permalink
generic_acl: no need to clone acl just to push it to set_cached_acl()
Browse files Browse the repository at this point in the history
In-core acls are copy-on-write, so the reference taken by set_cached_acl() will
do just fine.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 25, 2011
1 parent bc26ab5 commit 95203be
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions fs/generic_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,8 @@ generic_acl_init(struct inode *inode, struct inode *dir)
if (acl) {
struct posix_acl *clone;

if (S_ISDIR(inode->i_mode)) {
clone = posix_acl_clone(acl, GFP_KERNEL);
error = -ENOMEM;
if (!clone)
goto cleanup;
set_cached_acl(inode, ACL_TYPE_DEFAULT, clone);
posix_acl_release(clone);
}
if (S_ISDIR(inode->i_mode))
set_cached_acl(inode, ACL_TYPE_DEFAULT, acl);
clone = posix_acl_clone(acl, GFP_KERNEL);
error = -ENOMEM;
if (!clone)
Expand Down

0 comments on commit 95203be

Please sign in to comment.