]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/xfs/libxfs/xfs_bmap.c
Merge branch 'xfs-dax-updates' into for-next
[karo-tx-linux.git] / fs / xfs / libxfs / xfs_bmap.c
index 9390b7c8b5efd52630210a0e9d25229350e23843..119c2422aac78bcbfb65b8af527efff0aa8e5951 100644 (file)
@@ -948,14 +948,16 @@ xfs_bmap_local_to_extents(
        bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0);
 
        /*
-        * Initialise the block and copy the data
+        * Initialize the block, copy the data and log the remote buffer.
         *
-        * Note: init_fn must set the buffer log item type correctly!
+        * The callout is responsible for logging because the remote format
+        * might differ from the local format and thus we don't know how much to
+        * log here. Note that init_fn must also set the buffer log item type
+        * correctly.
         */
        init_fn(tp, bp, ip, ifp);
 
-       /* account for the change in fork size and log everything */
-       xfs_trans_log_buf(tp, bp, 0, ifp->if_bytes - 1);
+       /* account for the change in fork size */
        xfs_idata_realloc(ip, -ifp->if_bytes, whichfork);
        xfs_bmap_local_to_extents_empty(ip, whichfork);
        flags |= XFS_ILOG_CORE;
@@ -1435,7 +1437,7 @@ xfs_bmap_search_extents(
        xfs_ifork_t     *ifp;           /* inode fork pointer */
        xfs_bmbt_rec_host_t  *ep;            /* extent record pointer */
 
-       XFS_STATS_INC(xs_look_exlist);
+       XFS_STATS_INC(ip->i_mount, xs_look_exlist);
        ifp = XFS_IFORK_PTR(ip, fork);
 
        ep = xfs_bmap_search_multi_extents(ifp, bno, eofp, lastxp, gotp, prevp);
@@ -1732,7 +1734,7 @@ xfs_bmap_add_extent_delay_real(
        ASSERT(!bma->cur ||
               (bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL));
 
-       XFS_STATS_INC(xs_add_exlist);
+       XFS_STATS_INC(mp, xs_add_exlist);
 
 #define        LEFT            r[0]
 #define        RIGHT           r[1]
@@ -2286,7 +2288,7 @@ xfs_bmap_add_extent_unwritten_real(
        ASSERT(*idx <= ifp->if_bytes / sizeof(struct xfs_bmbt_rec));
        ASSERT(!isnullstartblock(new->br_startblock));
 
-       XFS_STATS_INC(xs_add_exlist);
+       XFS_STATS_INC(mp, xs_add_exlist);
 
 #define        LEFT            r[0]
 #define        RIGHT           r[1]
@@ -2946,7 +2948,7 @@ xfs_bmap_add_extent_hole_real(
        ASSERT(!bma->cur ||
               !(bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL));
 
-       XFS_STATS_INC(xs_add_exlist);
+       XFS_STATS_INC(mp, xs_add_exlist);
 
        state = 0;
        if (whichfork == XFS_ATTR_FORK)
@@ -4041,7 +4043,7 @@ xfs_bmapi_read(
        if (XFS_FORCED_SHUTDOWN(mp))
                return -EIO;
 
-       XFS_STATS_INC(xs_blk_mapr);
+       XFS_STATS_INC(mp, xs_blk_mapr);
 
        ifp = XFS_IFORK_PTR(ip, whichfork);
 
@@ -4226,7 +4228,7 @@ xfs_bmapi_delay(
        if (XFS_FORCED_SHUTDOWN(mp))
                return -EIO;
 
-       XFS_STATS_INC(xs_blk_mapw);
+       XFS_STATS_INC(mp, xs_blk_mapw);
 
        if (!(ifp->if_flags & XFS_IFEXTENTS)) {
                error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK);
@@ -4556,7 +4558,7 @@ xfs_bmapi_write(
 
        ifp = XFS_IFORK_PTR(ip, whichfork);
 
-       XFS_STATS_INC(xs_blk_mapw);
+       XFS_STATS_INC(mp, xs_blk_mapw);
 
        if (*firstblock == NULLFSBLOCK) {
                if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE)
@@ -4749,12 +4751,12 @@ xfs_bmap_del_extent(
        xfs_filblks_t           temp2;  /* for indirect length calculations */
        int                     state = 0;
 
-       XFS_STATS_INC(xs_del_exlist);
+       mp = ip->i_mount;
+       XFS_STATS_INC(mp, xs_del_exlist);
 
        if (whichfork == XFS_ATTR_FORK)
                state |= BMAP_ATTRFORK;
 
-       mp = ip->i_mount;
        ifp = XFS_IFORK_PTR(ip, whichfork);
        ASSERT((*idx >= 0) && (*idx < ifp->if_bytes /
                (uint)sizeof(xfs_bmbt_rec_t)));
@@ -5101,7 +5103,7 @@ xfs_bunmapi(
                *done = 1;
                return 0;
        }
-       XFS_STATS_INC(xs_blk_unmap);
+       XFS_STATS_INC(mp, xs_blk_unmap);
        isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip);
        start = bno;
        bno = start + len - 1;