]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: update both stat counters together in xlog_sync
authorChristoph Hellwig <hch@lst.de>
Sat, 29 Jun 2019 02:27:23 +0000 (19:27 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sat, 29 Jun 2019 02:27:23 +0000 (19:27 -0700)
Just a small bit of code tidying up.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_log.c

index 3534301451198c766d33128d436647023688bd74..9a6d456592e7fe154b5bac826e1f45ddec090087 100644 (file)
@@ -1859,7 +1859,6 @@ xlog_sync(
        unsigned int            size;
        bool                    need_flush = true;
 
-       XFS_STATS_INC(log->l_mp, xs_log_writes);
        ASSERT(atomic_read(&iclog->ic_refcnt) == 0);
 
        count = xlog_calc_iclog_size(log, iclog, &roundoff);
@@ -1877,6 +1876,7 @@ xlog_sync(
                size += roundoff;
        iclog->ic_header.h_len = cpu_to_be32(size);
 
+       XFS_STATS_INC(log->l_mp, xs_log_writes);
        XFS_STATS_ADD(log->l_mp, xs_log_blocks, BTOBB(count));
 
        bno = BLOCK_LSN(be64_to_cpu(iclog->ic_header.h_lsn));