From: Brian Foster Date: Thu, 4 Oct 2018 19:37:01 +0000 (-0500) Subject: xfs: remove unused btree cursor bc_private.a.dfops field X-Git-Tag: v4.19.0-rc0~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ff5ced09a3e0620515a66a440a6ee6062f70757;p=thirdparty%2Fxfsprogs-dev.git xfs: remove unused btree cursor bc_private.a.dfops field Source kernel commit: ed7ef8e55c6f24ae4347b5bda89e00af475ebc89 The xfs_btree_cur.bc_private.a.dfops field is only ever initialized by the refcountbt cursor init function. The only caller of that function with a non-NULL dfops is from deferred completion context, which already has attached to ->t_dfops. In addition to that, the only actual reference of a.dfops is the cursor duplication function, which means the field is effectively unused. Remove the dfops field from the bc_private.a union. Any future users can acquire the dfops from the transaction. This patch does not change behavior. Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h index 5b9553b5d..e9c0c7550 100644 --- a/libxfs/xfs_btree.h +++ b/libxfs/xfs_btree.h @@ -209,7 +209,6 @@ typedef struct xfs_btree_cur union { struct { /* needed for BNO, CNT, INO */ struct xfs_buf *agbp; /* agf/agi buffer pointer */ - struct xfs_defer_ops *dfops; /* deferred updates */ xfs_agnumber_t agno; /* ag number */ union xfs_btree_cur_private priv; } a; diff --git a/libxfs/xfs_refcount.c b/libxfs/xfs_refcount.c index ed08a81e2..cc2e720f2 100644 --- a/libxfs/xfs_refcount.c +++ b/libxfs/xfs_refcount.c @@ -1131,7 +1131,7 @@ xfs_refcount_finish_one( if (!agbp) return -EFSCORRUPTED; - rcur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno, dfops); + rcur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno); if (!rcur) { error = -ENOMEM; goto out_cur; @@ -1665,7 +1665,7 @@ xfs_refcount_recover_cow_leftovers( error = -ENOMEM; goto out_trans; } - cur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno, NULL); + cur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno); /* Find all the leftover CoW staging extents. */ memset(&low, 0, sizeof(low)); diff --git a/libxfs/xfs_refcount_btree.c b/libxfs/xfs_refcount_btree.c index 134204f52..0f998e2e8 100644 --- a/libxfs/xfs_refcount_btree.c +++ b/libxfs/xfs_refcount_btree.c @@ -26,8 +26,7 @@ xfs_refcountbt_dup_cursor( struct xfs_btree_cur *cur) { return xfs_refcountbt_init_cursor(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agbp, cur->bc_private.a.agno, - cur->bc_private.a.dfops); + cur->bc_private.a.agbp, cur->bc_private.a.agno); } STATIC void @@ -322,8 +321,7 @@ xfs_refcountbt_init_cursor( struct xfs_mount *mp, struct xfs_trans *tp, struct xfs_buf *agbp, - xfs_agnumber_t agno, - struct xfs_defer_ops *dfops) + xfs_agnumber_t agno) { struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); struct xfs_btree_cur *cur; @@ -343,7 +341,6 @@ xfs_refcountbt_init_cursor( cur->bc_private.a.agbp = agbp; cur->bc_private.a.agno = agno; - cur->bc_private.a.dfops = dfops; cur->bc_flags |= XFS_BTREE_CRC_BLOCKS; cur->bc_private.a.priv.refc.nr_ops = 0; diff --git a/libxfs/xfs_refcount_btree.h b/libxfs/xfs_refcount_btree.h index d2852b6e1..801c2c773 100644 --- a/libxfs/xfs_refcount_btree.h +++ b/libxfs/xfs_refcount_btree.h @@ -44,8 +44,8 @@ struct xfs_mount; ((index) - 1) * sizeof(xfs_refcount_ptr_t))) extern struct xfs_btree_cur *xfs_refcountbt_init_cursor(struct xfs_mount *mp, - struct xfs_trans *tp, struct xfs_buf *agbp, xfs_agnumber_t agno, - struct xfs_defer_ops *dfops); + struct xfs_trans *tp, struct xfs_buf *agbp, + xfs_agnumber_t agno); extern int xfs_refcountbt_maxrecs(int blocklen, bool leaf); extern void xfs_refcountbt_compute_maxlevels(struct xfs_mount *mp); diff --git a/repair/rmap.c b/repair/rmap.c index d9d086a79..d596d0ff8 100644 --- a/repair/rmap.c +++ b/repair/rmap.c @@ -1297,7 +1297,7 @@ check_refcounts( pag->pagf_init = 0; libxfs_perag_put(pag); - bt_cur = libxfs_refcountbt_init_cursor(mp, NULL, agbp, agno, NULL); + bt_cur = libxfs_refcountbt_init_cursor(mp, NULL, agbp, agno); if (!bt_cur) { error = -ENOMEM; goto err;