]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: use ->t_dfops in extent split tx and remove param
authorBrian Foster <bfoster@redhat.com>
Thu, 4 Oct 2018 19:28:01 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 4 Oct 2018 19:28:01 +0000 (14:28 -0500)
Source kernel commit: d76e6ce8ed6943941c0c964d8ae43fdaefdcbb5a

Attach the local dfops to ->t_dfops of the extent split transaction.
Since this is the only caller of xfs_bmap_split_extent_at(), remove
the dfops parameter as well.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c

index 25b620a60f0a197820dc3a1f7772d26882c06484..58df0960bae39084ef3a5fb66abce7bb7ab21322 100644 (file)
@@ -5910,8 +5910,7 @@ xfs_bmap_split_extent_at(
        struct xfs_trans        *tp,
        struct xfs_inode        *ip,
        xfs_fileoff_t           split_fsb,
-       xfs_fsblock_t           *firstfsb,
-       struct xfs_defer_ops    *dfops)
+       xfs_fsblock_t           *firstfsb)
 {
        int                             whichfork = XFS_DATA_FORK;
        struct xfs_btree_cur            *cur = NULL;
@@ -5961,7 +5960,7 @@ xfs_bmap_split_extent_at(
        if (ifp->if_flags & XFS_IFBROOT) {
                cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
                cur->bc_private.b.firstblock = *firstfsb;
-               cur->bc_private.b.dfops = dfops;
+               cur->bc_private.b.dfops = tp->t_dfops;
                cur->bc_private.b.flags = 0;
                error = xfs_bmbt_lookup_eq(cur, &got, &i);
                if (error)
@@ -6005,7 +6004,7 @@ xfs_bmap_split_extent_at(
                int tmp_logflags; /* partial log flag return val */
 
                ASSERT(cur == NULL);
-               error = xfs_bmap_extents_to_btree(tp, ip, firstfsb, dfops,
+               error = xfs_bmap_extents_to_btree(tp, ip, firstfsb, tp->t_dfops,
                                &cur, 0, &tmp_logflags, whichfork);
                logflags |= tmp_logflags;
        }
@@ -6037,14 +6036,14 @@ xfs_bmap_split_extent(
                        XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp);
        if (error)
                return error;
+       xfs_defer_init(&dfops, &firstfsb);
+       tp->t_dfops = &dfops;
 
        xfs_ilock(ip, XFS_ILOCK_EXCL);
        xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 
-       xfs_defer_init(&dfops, &firstfsb);
-
        error = xfs_bmap_split_extent_at(tp, ip, split_fsb,
-                       &firstfsb, &dfops);
+                                        &firstfsb);
        if (error)
                goto out;