aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_acl.c')
-rw-r--r--fs/xfs/xfs_acl.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 4ea73cc44259..0e2f37efedd0 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -152,12 +152,9 @@ xfs_get_acl(struct inode *inode, int type)
152 * go out to the disk. 152 * go out to the disk.
153 */ 153 */
154 len = XFS_ACL_MAX_SIZE(ip->i_mount); 154 len = XFS_ACL_MAX_SIZE(ip->i_mount);
155 xfs_acl = kmem_zalloc(len, KM_SLEEP | KM_MAYFAIL); 155 xfs_acl = kmem_zalloc_large(len, KM_SLEEP);
156 if (!xfs_acl) { 156 if (!xfs_acl)
157 xfs_acl = kmem_zalloc_large(len); 157 return ERR_PTR(-ENOMEM);
158 if (!xfs_acl)
159 return ERR_PTR(-ENOMEM);
160 }
161 158
162 error = -xfs_attr_get(ip, ea_name, (unsigned char *)xfs_acl, 159 error = -xfs_attr_get(ip, ea_name, (unsigned char *)xfs_acl,
163 &len, ATTR_ROOT); 160 &len, ATTR_ROOT);
@@ -181,10 +178,7 @@ xfs_get_acl(struct inode *inode, int type)
181out_update_cache: 178out_update_cache:
182 set_cached_acl(inode, type, acl); 179 set_cached_acl(inode, type, acl);
183out: 180out:
184 if (is_vmalloc_addr(xfs_acl)) 181 kmem_free(xfs_acl);
185 kmem_free_large(xfs_acl);
186 else
187 kfree(xfs_acl);
188 return acl; 182 return acl;
189} 183}
190 184
@@ -215,12 +209,9 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
215 struct xfs_acl *xfs_acl; 209 struct xfs_acl *xfs_acl;
216 int len = XFS_ACL_MAX_SIZE(ip->i_mount); 210 int len = XFS_ACL_MAX_SIZE(ip->i_mount);
217 211
218 xfs_acl = kmem_zalloc(len, KM_SLEEP | KM_MAYFAIL); 212 xfs_acl = kmem_zalloc_large(len, KM_SLEEP);
219 if (!xfs_acl) { 213 if (!xfs_acl)
220 xfs_acl = kmem_zalloc_large(len); 214 return -ENOMEM;
221 if (!xfs_acl)
222 return -ENOMEM;
223 }
224 215
225 xfs_acl_to_disk(xfs_acl, acl); 216 xfs_acl_to_disk(xfs_acl, acl);
226 217
@@ -231,10 +222,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
231 error = -xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl, 222 error = -xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl,
232 len, ATTR_ROOT); 223 len, ATTR_ROOT);
233 224
234 if (is_vmalloc_addr(xfs_acl)) 225 kmem_free(xfs_acl);
235 kmem_free_large(xfs_acl);
236 else
237 kfree(xfs_acl);
238 } else { 226 } else {
239 /* 227 /*
240 * A NULL ACL argument means we want to remove the ACL. 228 * A NULL ACL argument means we want to remove the ACL.