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

xfs: convert kmem_free() for kvmalloc users to kvfree()



Start getting rid of kmem_free() by converting all the cases where
memory can come from vmalloc interfaces to calling kvfree()
directly.

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 afdc1155
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ xfs_get_acl(struct inode *inode, int type, bool rcu)
		acl = ERR_PTR(error);
	}

	kmem_free(args.value);
	kvfree(args.value);
	return acl;
}

@@ -204,7 +204,7 @@ __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
	}

	error = xfs_attr_change(&args);
	kmem_free(args.value);
	kvfree(args.value);

	/*
	 * If the attribute didn't exist to start with that's fine.
+2 −2
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ STATIC void
xfs_attri_item_free(
	struct xfs_attri_log_item	*attrip)
{
	kmem_free(attrip->attri_item.li_lv_shadow);
	kvfree(attrip->attri_item.li_lv_shadow);
	xfs_attri_log_nameval_put(attrip->attri_nameval);
	kmem_cache_free(xfs_attri_cache, attrip);
}
@@ -251,7 +251,7 @@ static inline struct xfs_attrd_log_item *ATTRD_ITEM(struct xfs_log_item *lip)
STATIC void
xfs_attrd_item_free(struct xfs_attrd_log_item *attrdp)
{
	kmem_free(attrdp->attrd_item.li_lv_shadow);
	kvfree(attrdp->attrd_item.li_lv_shadow);
	kmem_cache_free(xfs_attrd_cache, attrdp);
}

+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ STATIC void
xfs_bui_item_free(
	struct xfs_bui_log_item	*buip)
{
	kmem_free(buip->bui_item.li_lv_shadow);
	kvfree(buip->bui_item.li_lv_shadow);
	kmem_cache_free(xfs_bui_cache, buip);
}

@@ -201,7 +201,7 @@ xfs_bud_item_release(
	struct xfs_bud_log_item	*budp = BUD_ITEM(lip);

	xfs_bui_release(budp->bud_buip);
	kmem_free(budp->bud_item.li_lv_shadow);
	kvfree(budp->bud_item.li_lv_shadow);
	kmem_cache_free(xfs_bud_cache, budp);
}

+1 −1
Original line number Diff line number Diff line
@@ -1044,7 +1044,7 @@ xfs_buf_item_free(
	struct xfs_buf_log_item	*bip)
{
	xfs_buf_item_free_format(bip);
	kmem_free(bip->bli_item.li_lv_shadow);
	kvfree(bip->bli_item.li_lv_shadow);
	kmem_cache_free(xfs_buf_item_cache, bip);
}

+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ xfs_qm_dqdestroy(
{
	ASSERT(list_empty(&dqp->q_lru));

	kmem_free(dqp->q_logitem.qli_item.li_lv_shadow);
	kvfree(dqp->q_logitem.qli_item.li_lv_shadow);
	mutex_destroy(&dqp->q_qlock);

	XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot);
Loading