diff mbox series

[31/36] libxfs: refactor the open-coded libxfs_trans_bjoin calls

Message ID 155259762358.31886.5732556054840025852.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfsprogs-5.0: fix various problems | expand

Commit Message

Darrick J. Wong March 14, 2019, 9:07 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Refactor open-coded bjoin code to use libxfs_trans_bjoin.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/trans.c |   18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

Comments

Eric Sandeen April 5, 2019, 6:39 p.m. UTC | #1
On 3/14/19 4:07 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Refactor open-coded bjoin code to use libxfs_trans_bjoin.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  libxfs/trans.c |   18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> 
> diff --git a/libxfs/trans.c b/libxfs/trans.c
> index 10a35dd4..7bdd1544 100644
> --- a/libxfs/trans.c
> +++ b/libxfs/trans.c
> @@ -663,13 +663,9 @@ libxfs_trans_get_buf_map(
>  	fprintf(stderr, "trans_get_buf buffer %p, transaction %p\n", bp, tp);
>  #endif
>  
> -	xfs_buf_item_init(bp, tp->t_mountp);
> +	libxfs_trans_bjoin(tp, bp);
>  	bip = bp->b_log_item;
>  	bip->bli_recur = 0;
> -	xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
> -
> -	/* initialize b_transp so we can find it incore */
> -	bp->b_transp = tp;
>  	return bp;
>  }
>  
> @@ -701,13 +697,9 @@ libxfs_trans_getsb(
>  	fprintf(stderr, "trans_get_sb buffer %p, transaction %p\n", bp, tp);
>  #endif
>  
> -	xfs_buf_item_init(bp, mp);
> +	libxfs_trans_bjoin(tp, bp);
>  	bip = bp->b_log_item;
>  	bip->bli_recur = 0;
> -	xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
> -
> -	/* initialize b_transp so we can find it incore */
> -	bp->b_transp = tp;
>  	return bp;
>  }
>  
> @@ -758,13 +750,9 @@ libxfs_trans_read_buf_map(
>  	fprintf(stderr, "trans_read_buf buffer %p, transaction %p\n", bp, tp);
>  #endif
>  
> -	xfs_buf_item_init(bp, tp->t_mountp);
> +	xfs_trans_bjoin(tp, bp);
>  	bip = bp->b_log_item;
>  	bip->bli_recur = 0z
> -	xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
> -
> -	/* initialise b_transp so we can find it incore */
> -	bp->b_transp = tp;
>  done:
>  	*bpp = bp;
>  	return 0;
>
diff mbox series

Patch

diff --git a/libxfs/trans.c b/libxfs/trans.c
index 10a35dd4..7bdd1544 100644
--- a/libxfs/trans.c
+++ b/libxfs/trans.c
@@ -663,13 +663,9 @@  libxfs_trans_get_buf_map(
 	fprintf(stderr, "trans_get_buf buffer %p, transaction %p\n", bp, tp);
 #endif
 
-	xfs_buf_item_init(bp, tp->t_mountp);
+	libxfs_trans_bjoin(tp, bp);
 	bip = bp->b_log_item;
 	bip->bli_recur = 0;
-	xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
-
-	/* initialize b_transp so we can find it incore */
-	bp->b_transp = tp;
 	return bp;
 }
 
@@ -701,13 +697,9 @@  libxfs_trans_getsb(
 	fprintf(stderr, "trans_get_sb buffer %p, transaction %p\n", bp, tp);
 #endif
 
-	xfs_buf_item_init(bp, mp);
+	libxfs_trans_bjoin(tp, bp);
 	bip = bp->b_log_item;
 	bip->bli_recur = 0;
-	xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
-
-	/* initialize b_transp so we can find it incore */
-	bp->b_transp = tp;
 	return bp;
 }
 
@@ -758,13 +750,9 @@  libxfs_trans_read_buf_map(
 	fprintf(stderr, "trans_read_buf buffer %p, transaction %p\n", bp, tp);
 #endif
 
-	xfs_buf_item_init(bp, tp->t_mountp);
+	xfs_trans_bjoin(tp, bp);
 	bip = bp->b_log_item;
 	bip->bli_recur = 0;
-	xfs_trans_add_item(tp, (xfs_log_item_t *)bip);
-
-	/* initialise b_transp so we can find it incore */
-	bp->b_transp = tp;
 done:
 	*bpp = bp;
 	return 0;