* go out to the disk.
*/
len = XFS_ACL_MAX_SIZE(ip->i_mount);
- xfs_acl = kzalloc(len, GFP_KERNEL);
- if (!xfs_acl)
- return ERR_PTR(-ENOMEM);
+ xfs_acl = kmem_zalloc(len, KM_SLEEP | KM_MAYFAIL);
+ if (!xfs_acl) {
+ xfs_acl = kmem_zalloc_large(len);
+ if (!xfs_acl)
+ return ERR_PTR(-ENOMEM);
+ }
error = -xfs_attr_get(ip, ea_name, (unsigned char *)xfs_acl,
&len, ATTR_ROOT);
if (IS_ERR(acl))
goto out;
- out_update_cache:
+out_update_cache:
set_cached_acl(inode, type, acl);
- out:
- kfree(xfs_acl);
+out:
+ if (is_vmalloc_addr(xfs_acl))
+ kmem_free_large(xfs_acl);
+ else
+ kfree(xfs_acl);
return acl;
}
struct xfs_acl *xfs_acl;
int len = XFS_ACL_MAX_SIZE(ip->i_mount);
- xfs_acl = kzalloc(len, GFP_KERNEL);
- if (!xfs_acl)
- return -ENOMEM;
+ xfs_acl = kmem_zalloc(len, KM_SLEEP | KM_MAYFAIL);
+ if (!xfs_acl) {
+ xfs_acl = kmem_zalloc_large(len);
+ if (!xfs_acl)
+ return -ENOMEM;
+ }
xfs_acl_to_disk(xfs_acl, acl);
error = -xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl,
len, ATTR_ROOT);
- kfree(xfs_acl);
+ if (is_vmalloc_addr(xfs_acl))
+ kmem_free_large(xfs_acl);
+ else
+ kfree(xfs_acl);
} else {
/*
* A NULL ACL argument means we want to remove the ACL.