Commit 10634530 authored by Dave Chinner's avatar Dave Chinner Committed by Chandan Babu R
Browse files

xfs: convert kmem_zalloc() to kzalloc()



There's no reason to keep the kmem_zalloc() around anymore, it's
just a thin wrapper around kmalloc(), so lets get rid of it.

Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
parent 841c3516
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -62,13 +62,6 @@ static inline void kmem_free(const void *ptr)
	kvfree(ptr);
}


static inline void *
kmem_zalloc(size_t size, xfs_km_flags_t flags)
{
	return kmem_alloc(size, flags | KM_ZERO);
}

/*
 * Zone interfaces
 */
+1 −1
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ xfs_initialize_perag(
			continue;
		}

		pag = kmem_zalloc(sizeof(*pag), KM_MAYFAIL);
		pag = kzalloc(sizeof(*pag), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
		if (!pag) {
			error = -ENOMEM;
			goto out_unwind_new_pags;
+2 −1
Original line number Diff line number Diff line
@@ -2250,7 +2250,8 @@ xfs_attr3_leaf_unbalance(
		struct xfs_attr_leafblock *tmp_leaf;
		struct xfs_attr3_icleaf_hdr tmphdr;

		tmp_leaf = kmem_zalloc(state->args->geo->blksize, 0);
		tmp_leaf = kzalloc(state->args->geo->blksize,
				GFP_KERNEL | __GFP_NOFAIL);

		/*
		 * Copy the header into the temp leaf so that all the stuff
+1 −1
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ xfs_btree_bload_prep_block(

		/* Allocate a new incore btree root block. */
		new_size = bbl->iroot_size(cur, level, nr_this_block, priv);
		ifp->if_broot = kmem_zalloc(new_size, 0);
		ifp->if_broot = kzalloc(new_size, GFP_KERNEL);
		ifp->if_broot_bytes = (int)new_size;

		/* Initialize it and send it out. */
+3 −2
Original line number Diff line number Diff line
@@ -2518,7 +2518,7 @@ xfs_dabuf_map(
	int			error = 0, nirecs, i;

	if (nfsb > 1)
		irecs = kmem_zalloc(sizeof(irec) * nfsb, KM_NOFS);
		irecs = kzalloc(sizeof(irec) * nfsb, GFP_NOFS | __GFP_NOFAIL);

	nirecs = nfsb;
	error = xfs_bmapi_read(dp, bno, nfsb, irecs, &nirecs,
@@ -2531,7 +2531,8 @@ xfs_dabuf_map(
	 * larger one that needs to be free by the caller.
	 */
	if (nirecs > 1) {
		map = kmem_zalloc(nirecs * sizeof(struct xfs_buf_map), KM_NOFS);
		map = kzalloc(nirecs * sizeof(struct xfs_buf_map),
				GFP_NOFS | __GFP_NOFAIL);
		if (!map) {
			error = -ENOMEM;
			goto out_free_irecs;
Loading