]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: clean up refcount log intent item tracepoint callsites
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:21:42 +0000 (14:21 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:13:14 +0000 (17:13 -0700)
Pass the incore refcount intent structure to the tracepoints instead of
open-coding the argument passing.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_refcount.c
libxfs/xfs_refcount.h

index 31b6549f5f3abda60b64c68a2af319a28c5dea03..14d1101b400b6cc934ef6365e61b810e11d025ea 100644 (file)
@@ -1366,9 +1366,7 @@ xfs_refcount_finish_one(
 
        bno = XFS_FSB_TO_AGBNO(mp, ri->ri_startblock);
 
-       trace_xfs_refcount_deferred(mp, XFS_FSB_TO_AGNO(mp, ri->ri_startblock),
-                       ri->ri_type, XFS_FSB_TO_AGBNO(mp, ri->ri_startblock),
-                       ri->ri_blockcount);
+       trace_xfs_refcount_deferred(mp, ri);
 
        if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_REFCOUNT_FINISH_ONE))
                return -EIO;
@@ -1431,8 +1429,7 @@ xfs_refcount_finish_one(
                return -EFSCORRUPTED;
        }
        if (!error && ri->ri_blockcount > 0)
-               trace_xfs_refcount_finish_one_leftover(mp, ri->ri_pag->pag_agno,
-                               ri->ri_type, bno, ri->ri_blockcount);
+               trace_xfs_refcount_finish_one_leftover(mp, ri);
        return error;
 }
 
@@ -1448,11 +1445,6 @@ __xfs_refcount_add(
 {
        struct xfs_refcount_intent      *ri;
 
-       trace_xfs_refcount_defer(tp->t_mountp,
-                       XFS_FSB_TO_AGNO(tp->t_mountp, startblock),
-                       type, XFS_FSB_TO_AGBNO(tp->t_mountp, startblock),
-                       blockcount);
-
        ri = kmem_cache_alloc(xfs_refcount_intent_cache,
                        GFP_KERNEL | __GFP_NOFAIL);
        INIT_LIST_HEAD(&ri->ri_list);
@@ -1460,6 +1452,8 @@ __xfs_refcount_add(
        ri->ri_startblock = startblock;
        ri->ri_blockcount = blockcount;
 
+       trace_xfs_refcount_defer(tp->t_mountp, ri);
+
        xfs_refcount_update_get_group(tp->t_mountp, ri);
        xfs_defer_add(tp, &ri->ri_list, &xfs_refcount_update_defer_type);
 }
index 9b56768a590c01f5adf132abf3a77f9bd67f90d8..01a20621192ed2d434eaa696fed5e92dfdd199f0 100644 (file)
@@ -48,6 +48,12 @@ enum xfs_refcount_intent_type {
        XFS_REFCOUNT_FREE_COW,
 };
 
+#define XFS_REFCOUNT_INTENT_STRINGS \
+       { XFS_REFCOUNT_INCREASE,        "incr" }, \
+       { XFS_REFCOUNT_DECREASE,        "decr" }, \
+       { XFS_REFCOUNT_ALLOC_COW,       "alloc_cow" }, \
+       { XFS_REFCOUNT_FREE_COW,        "free_cow" }
+
 struct xfs_refcount_intent {
        struct list_head                        ri_list;
        struct xfs_perag                        *ri_pag;