]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move stat accounting to xfs_bmapi_convert_delalloc
authorChristoph Hellwig <hch@lst.de>
Mon, 6 May 2019 22:00:29 +0000 (18:00 -0400)
committerEric Sandeen <sandeen@redhat.com>
Mon, 6 May 2019 22:00:29 +0000 (18:00 -0400)
Source kernel commit: 125851ac92d62b966df851c6f34147121020af2f

This way we can actually count how many bytes got converted and how many
calls we need, unlike in the caller which doesn't have the detailed
view.

Note that this includes a slight change in behavior as the
xs_xstrat_quick is now bumped for every allocation instead of just the
one covering the requested writeback offset, which makes a lot more
sense.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
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_bmap.c

index 9c312b6ca6c2e4117facae29ff7f3e789e70d256..60769f3ac71a827c9f79e4ffa6bf9de354d185ff 100644 (file)
@@ -4507,6 +4507,9 @@ xfs_bmapi_convert_delalloc(
        if (WARN_ON_ONCE(!bma.got.br_startblock && !XFS_IS_REALTIME_INODE(ip)))
                goto out_finish;
 
+       XFS_STATS_ADD(mp, xs_xstrat_bytes, XFS_FSB_TO_B(mp, bma.length));
+       XFS_STATS_INC(mp, xs_xstrat_quick);
+
        ASSERT(!isnullstartblock(bma.got.br_startblock));
        *imap = bma.got;
        *seq = READ_ONCE(ifp->if_seq);