]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove unused btree cursor bc_private.a.dfops field
authorBrian Foster <bfoster@redhat.com>
Thu, 4 Oct 2018 19:37:01 +0000 (14:37 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 4 Oct 2018 19:37:01 +0000 (14:37 -0500)
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 <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_btree.h
libxfs/xfs_refcount.c
libxfs/xfs_refcount_btree.c
libxfs/xfs_refcount_btree.h
repair/rmap.c

index 5b9553b5df1dc9815e6d0e91ae5a69fc6362fc24..e9c0c7550ac16615c99fce59b28e51774bfd2398 100644 (file)
@@ -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;
index ed08a81e2402844ba80b5a31fc698604efffad47..cc2e720f28b4417c0b8055d1b5d5b22ea3dd05a8 100644 (file)
@@ -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));
index 134204f52db8f3463bd846bed80484c4215f490a..0f998e2e841ba70605a2e418187c69b7e7cc0c4c 100644 (file)
@@ -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;
index d2852b6e1fa8a888eef79934de814b40e5a2ea4c..801c2c7732fd7985e8ff0c230718f6aaa49764dd 100644 (file)
@@ -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);
 
index d9d086a7936e7f6e2cb44d8eea01eafd576e832a..d596d0ff8b860f988d3ea67e12c1b8166e91f31e 100644 (file)
@@ -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;