Commit 8ca79df8 authored by Carlos Maiolino's avatar Carlos Maiolino Committed by Darrick J. Wong

xfs: Remove kmem_zalloc_large()

This patch aims to replace kmem_zalloc_large() with global kernel memory
API. So, all its callers are now using kvzalloc() directly, so kmalloc()
fallsback to vmalloc() automatically.
Signed-off-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 29887a22
...@@ -71,12 +71,6 @@ kmem_zalloc(size_t size, xfs_km_flags_t flags) ...@@ -71,12 +71,6 @@ kmem_zalloc(size_t size, xfs_km_flags_t flags)
return kmem_alloc(size, flags | KM_ZERO); return kmem_alloc(size, flags | KM_ZERO);
} }
static inline void *
kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
{
return kmem_alloc_large(size, flags | KM_ZERO);
}
/* /*
* Zone interfaces * Zone interfaces
*/ */
......
...@@ -22,7 +22,7 @@ xchk_setup_symlink( ...@@ -22,7 +22,7 @@ xchk_setup_symlink(
struct xfs_inode *ip) struct xfs_inode *ip)
{ {
/* Allocate the buffer without the inode lock held. */ /* Allocate the buffer without the inode lock held. */
sc->buf = kmem_zalloc_large(XFS_SYMLINK_MAXLEN + 1, 0); sc->buf = kvzalloc(XFS_SYMLINK_MAXLEN + 1, GFP_KERNEL);
if (!sc->buf) if (!sc->buf)
return -ENOMEM; return -ENOMEM;
......
...@@ -192,7 +192,7 @@ __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) ...@@ -192,7 +192,7 @@ __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
if (acl) { if (acl) {
args.valuelen = XFS_ACL_SIZE(acl->a_count); args.valuelen = XFS_ACL_SIZE(acl->a_count);
args.value = kmem_zalloc_large(args.valuelen, 0); args.value = kvzalloc(args.valuelen, GFP_KERNEL);
if (!args.value) if (!args.value)
return -ENOMEM; return -ENOMEM;
xfs_acl_to_disk(args.value, acl); xfs_acl_to_disk(args.value, acl);
......
...@@ -404,7 +404,7 @@ xfs_ioc_attr_list( ...@@ -404,7 +404,7 @@ xfs_ioc_attr_list(
context.cursor.offset)) context.cursor.offset))
return -EINVAL; return -EINVAL;
buffer = kmem_zalloc_large(bufsize, 0); buffer = kvzalloc(bufsize, GFP_KERNEL);
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
...@@ -1691,7 +1691,7 @@ xfs_ioc_getbmap( ...@@ -1691,7 +1691,7 @@ xfs_ioc_getbmap(
if (bmx.bmv_count > ULONG_MAX / recsize) if (bmx.bmv_count > ULONG_MAX / recsize)
return -ENOMEM; return -ENOMEM;
buf = kmem_zalloc_large(bmx.bmv_count * sizeof(*buf), 0); buf = kvzalloc(bmx.bmv_count * sizeof(*buf), GFP_KERNEL);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
......
...@@ -862,7 +862,7 @@ xfs_alloc_rsum_cache( ...@@ -862,7 +862,7 @@ xfs_alloc_rsum_cache(
* lower bound on the minimum level with any free extents. We can * lower bound on the minimum level with any free extents. We can
* continue without the cache if it couldn't be allocated. * continue without the cache if it couldn't be allocated.
*/ */
mp->m_rsum_cache = kmem_zalloc_large(rbmblocks, 0); mp->m_rsum_cache = kvzalloc(rbmblocks, GFP_KERNEL);
if (!mp->m_rsum_cache) if (!mp->m_rsum_cache)
xfs_warn(mp, "could not allocate realtime summary cache"); xfs_warn(mp, "could not allocate realtime summary cache");
} }
......
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