From ebeb8e062906e1f715908e3e339eb197b7121ad0 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 28 Jun 2019 19:27:35 -0700 Subject: xfs: merge xfs_cud_init into xfs_trans_get_cud There is no good reason to keep these two functions separate. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_refcount_item.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'fs/xfs/xfs_refcount_item.c') diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c index a4a2296546b6..fc2dfe92c43a 100644 --- a/fs/xfs/xfs_refcount_item.c +++ b/fs/xfs/xfs_refcount_item.c @@ -217,22 +217,20 @@ static const struct xfs_item_ops xfs_cud_item_ops = { .iop_release = xfs_cud_item_release, }; -/* - * Allocate and initialize an cud item with the given number of extents. - */ struct xfs_cud_log_item * -xfs_cud_init( - struct xfs_mount *mp, +xfs_trans_get_cud( + struct xfs_trans *tp, struct xfs_cui_log_item *cuip) - { - struct xfs_cud_log_item *cudp; + struct xfs_cud_log_item *cudp; cudp = kmem_zone_zalloc(xfs_cud_zone, KM_SLEEP); - xfs_log_item_init(mp, &cudp->cud_item, XFS_LI_CUD, &xfs_cud_item_ops); + xfs_log_item_init(tp->t_mountp, &cudp->cud_item, XFS_LI_CUD, + &xfs_cud_item_ops); cudp->cud_cuip = cuip; cudp->cud_format.cud_cui_id = cuip->cui_format.cui_id; + xfs_trans_add_item(tp, &cudp->cud_item); return cudp; } -- cgit v1.2.3