]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove XFS_BMAP_TRACE_EXLIST
authorChristoph Hellwig <hch@lst.de>
Fri, 17 Nov 2017 04:11:33 +0000 (22:11 -0600)
committerEric Sandeen <sandeen@redhat.com>
Fri, 17 Nov 2017 04:11:33 +0000 (22:11 -0600)
Source kernel commit: e8e0e170e2e17b601b86edb86f58dbf7c599e4b3

Instead of looping over all extents in some debug-only helper just
insert trace points into the loops that already exist in the calling
functions.

Also split the xfs_extlist trace point into one each for reading and
writing extents from disk.

Signed-off-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>
[sandeen: userspace-specific tracepoint macro updates]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_trace.h
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h
libxfs/xfs_inode_fork.c

index 4d8aa68914ff72d1646133d7ae1f407fa6148294..28225dd1599198170f27db0214fb302ed4aafba8 100644 (file)
 
 #define trace_xfs_bmap_pre_update(a,b,c,d)     ((void) 0)
 #define trace_xfs_bmap_post_update(a,b,c,d)    ((void) 0)
-#define trace_xfs_extlist(a,b,c,d)     ((void) 0)
-#define trace_xfs_bunmap(a,b,c,d,e)    ((void) 0)
+#define trace_xfs_bunmap(a,b,c,d,e)            ((void) 0)
 
 /* set c = c to avoid unused var warnings */
+#define trace_xfs_read_extent(a,b,c,d) ((c) = (c))
+#define trace_xfs_write_extent(a,b,c,d)        ((c) = (c))
 #define trace_xfs_perag_get(a,b,c,d)   ((c) = (c))
 #define trace_xfs_perag_get_tag(a,b,c,d) ((c) = (c))
 #define trace_xfs_perag_put(a,b,c,d)   ((c) = (c))
index cb3dc85943bf88baa9e111c5a6a8e4f67b8a9700..eebdae30752ad3ed479acb2ff7f8e82a3e9f3fce 100644 (file)
@@ -478,26 +478,6 @@ error_norelse:
        return;
 }
 
-/*
- * Add bmap trace insert entries for all the contents of the extent records.
- */
-void
-xfs_bmap_trace_exlist(
-       xfs_inode_t     *ip,            /* incore inode pointer */
-       xfs_extnum_t    cnt,            /* count of entries in the list */
-       int             whichfork,      /* data or attr or cow fork */
-       unsigned long   caller_ip)
-{
-       xfs_extnum_t    idx;            /* extent record index */
-       xfs_ifork_t     *ifp;           /* inode fork pointer */
-       int             state = xfs_bmap_fork_to_state(whichfork);
-
-       ifp = XFS_IFORK_PTR(ip, whichfork);
-       ASSERT(cnt == xfs_iext_count(ifp));
-       for (idx = 0; idx < cnt; idx++)
-               trace_xfs_extlist(ip, idx, state, caller_ip);
-}
-
 /*
  * Validate that the bmbt_irecs being returned from bmapi are valid
  * given the caller's original parameters.  Specifically check the
@@ -1201,6 +1181,7 @@ xfs_bmap_read_extents(
        __be64                  *pp;    /* pointer to block address */
        /* REFERENCED */
        xfs_extnum_t            room;   /* number of entries there's room for */
+       int                     state = xfs_bmap_fork_to_state(whichfork);
 
        mp = ip->i_mount;
        ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -1274,6 +1255,7 @@ xfs_bmap_read_extents(
                                                 XFS_ERRLEVEL_LOW, mp);
                                goto error0;
                        }
+                       trace_xfs_read_extent(ip, i, state, _THIS_IP_);
                }
                xfs_trans_brelse(tp, bp);
                bno = nextbno;
@@ -1291,7 +1273,6 @@ xfs_bmap_read_extents(
        if (i != XFS_IFORK_NEXTENTS(ip, whichfork))
                return -EFSCORRUPTED;
        ASSERT(i == xfs_iext_count(ifp));
-       XFS_BMAP_TRACE_EXLIST(ip, i, whichfork);
        return 0;
 error0:
        xfs_trans_brelse(tp, bp);
index 612d3c7786913efff257f78785f444d0baa93ab8..50b8977163ecf100228f77f41eb68331b86a5ca8 100644 (file)
@@ -197,15 +197,6 @@ enum shift_direction {
        SHIFT_RIGHT,
 };
 
-#ifdef DEBUG
-void   xfs_bmap_trace_exlist(struct xfs_inode *ip, xfs_extnum_t cnt,
-               int whichfork, unsigned long caller_ip);
-#define        XFS_BMAP_TRACE_EXLIST(ip,c,w)   \
-       xfs_bmap_trace_exlist(ip,c,w, _THIS_IP_)
-#else
-#define        XFS_BMAP_TRACE_EXLIST(ip,c,w)
-#endif
-
 void   xfs_trim_extent(struct xfs_bmbt_irec *irec, xfs_fileoff_t bno,
                xfs_filblks_t len);
 void   xfs_trim_extent_eof(struct xfs_bmbt_irec *, struct xfs_inode *);
index f4fa3250281f30ff60981fcaf3c7075fc8ed997b..da0cfe23682d4eabb72c72ed415f4fb5d56669f5 100644 (file)
@@ -333,6 +333,7 @@ xfs_iformat_extents(
 {
        struct xfs_mount        *mp = ip->i_mount;
        struct xfs_ifork        *ifp = XFS_IFORK_PTR(ip, whichfork);
+       int                     state = xfs_bmap_fork_to_state(whichfork);
        int                     nex = XFS_DFORK_NEXTENTS(dip, whichfork);
        int                     size = nex * sizeof(xfs_bmbt_rec_t);
        struct xfs_bmbt_rec     *dp;
@@ -370,8 +371,8 @@ xfs_iformat_extents(
                                                 XFS_ERRLEVEL_LOW, mp);
                                return -EFSCORRUPTED;
                        }
+                       trace_xfs_read_extent(ip, i, state, _THIS_IP_);
                }
-               XFS_BMAP_TRACE_EXLIST(ip, nex, whichfork);
        }
        ifp->if_flags |= XFS_IFEXTENTS;
        return 0;
@@ -769,6 +770,7 @@ xfs_iextents_copy(
        xfs_bmbt_rec_t          *dp,
        int                     whichfork)
 {
+       int                     state = xfs_bmap_fork_to_state(whichfork);
        int                     copied;
        int                     i;
        xfs_ifork_t             *ifp;
@@ -780,7 +782,6 @@ xfs_iextents_copy(
        ASSERT(ifp->if_bytes > 0);
 
        nrecs = xfs_iext_count(ifp);
-       XFS_BMAP_TRACE_EXLIST(ip, nrecs, whichfork);
        ASSERT(nrecs > 0);
 
        /*
@@ -803,9 +804,12 @@ xfs_iextents_copy(
                        continue;
                }
 
+               trace_xfs_write_extent(ip, i, state, _RET_IP_);
+
                /* Translate to on disk format */
                put_unaligned_be64(ep->l0, &dp->l0);
                put_unaligned_be64(ep->l1, &dp->l1);
+
                dp++;
                copied++;
        }