diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 02:41:54 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:27:31 -0400 |
commit | 95203befa8887997f14077d8557e67d78457ee02 (patch) | |
tree | 6c00a95e1f5cf6c61d2b74f3f6865a4e90bbc6f6 /fs | |
parent | bc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (diff) |
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: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/generic_acl.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/generic_acl.c b/fs/generic_acl.c index 3a60d9d1653c..134782116a62 100644 --- a/fs/generic_acl.c +++ b/fs/generic_acl.c | |||
@@ -134,14 +134,8 @@ generic_acl_init(struct inode *inode, struct inode *dir) | |||
134 | if (acl) { | 134 | if (acl) { |
135 | struct posix_acl *clone; | 135 | struct posix_acl *clone; |
136 | 136 | ||
137 | if (S_ISDIR(inode->i_mode)) { | 137 | if (S_ISDIR(inode->i_mode)) |
138 | clone = posix_acl_clone(acl, GFP_KERNEL); | 138 | set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); |
139 | error = -ENOMEM; | ||
140 | if (!clone) | ||
141 | goto cleanup; | ||
142 | set_cached_acl(inode, ACL_TYPE_DEFAULT, clone); | ||
143 | posix_acl_release(clone); | ||
144 | } | ||
145 | clone = posix_acl_clone(acl, GFP_KERNEL); | 139 | clone = posix_acl_clone(acl, GFP_KERNEL); |
146 | error = -ENOMEM; | 140 | error = -ENOMEM; |
147 | if (!clone) | 141 | if (!clone) |