xfs: remove xfs_bmapi_write() dfops param
authorBrian Foster <bfoster@redhat.com>
Thu, 12 Jul 2018 05:26:12 +0000 (22:26 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Jul 2018 05:26:12 +0000 (22:26 -0700)
Now that all callers use ->t_dfops, the xfs_bmapi_write() dfops
parameter is no longer necessary. Remove it and access ->t_dfops
directly. This patch does not change behavior.

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>
fs/xfs/libxfs/xfs_attr_remote.c
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap.h
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_dquot.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_reflink.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_symlink.c

index 577c4c3722651dca56caae7e128623c2c961827f..1f2bc86a28edd6380ddeb894cc57fce963756ecf 100644 (file)
@@ -484,8 +484,7 @@ xfs_attr_rmtval_set(
                nmap = 1;
                error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
                                  blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
-                                 args->total, &map, &nmap,
-                                 args->trans->t_dfops);
+                                 args->total, &map, &nmap);
                if (error)
                        goto out_defer_cancel;
                xfs_defer_ijoin(args->trans->t_dfops, dp);
index c65aeb088552ccc807fc3517c3c5937f05d6be8b..02e72c195c4f27448f44e46632c6c057d006c9dd 100644 (file)
@@ -4245,8 +4245,7 @@ xfs_bmapi_write(
                                                   controls a.g. for allocs */
        xfs_extlen_t            total,          /* total blocks needed */
        struct xfs_bmbt_irec    *mval,          /* output: map values */
-       int                     *nmap,          /* i/o: mval size/count */
-       struct xfs_defer_ops    *dfops)         /* i/o: list extents to free */
+       int                     *nmap)          /* i/o: mval size/count */
 {
        struct xfs_mount        *mp = ip->i_mount;
        struct xfs_ifork        *ifp;
@@ -4337,7 +4336,7 @@ xfs_bmapi_write(
        bma.ip = ip;
        bma.total = total;
        bma.datatype = 0;
-       bma.dfops = dfops;
+       bma.dfops = tp ? tp->t_dfops : NULL;
        bma.firstblock = firstblock;
 
        while (bno < end && n < *nmap) {
@@ -4414,8 +4413,9 @@ xfs_bmapi_write(
                         * the refcount btree for orphan recovery.
                         */
                        if (whichfork == XFS_COW_FORK) {
-                               error = xfs_refcount_alloc_cow_extent(mp, dfops,
-                                               bma.blkno, bma.length);
+                               error = xfs_refcount_alloc_cow_extent(mp,
+                                               tp->t_dfops, bma.blkno,
+                                               bma.length);
                                if (error)
                                        goto error0;
                        }
index 44639588d1c7a1fbf929984f153fb68ce6feac9b..fc86cc218c58882e3b9adcd5774954f89ce78639 100644 (file)
@@ -203,8 +203,7 @@ int xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno,
 int    xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
                xfs_fileoff_t bno, xfs_filblks_t len, int flags,
                xfs_fsblock_t *firstblock, xfs_extlen_t total,
-               struct xfs_bmbt_irec *mval, int *nmap,
-               struct xfs_defer_ops *dfops);
+               struct xfs_bmbt_irec *mval, int *nmap);
 int    __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
                xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags,
                xfs_extnum_t nexts, xfs_fsblock_t *firstblock,
index d2048e4e93ec98bcd9d57e4e3e27765b31d15cf0..e43f1dda02e489ece3fb758e302a0b9f6b8bf6f5 100644 (file)
@@ -2062,8 +2062,7 @@ xfs_da_grow_inode_int(
        ASSERT(args->firstblock != NULL);
        error = xfs_bmapi_write(tp, dp, *bno, count,
                        xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
-                       args->firstblock, args->total, &map, &nmap,
-                       args->trans->t_dfops);
+                       args->firstblock, args->total, &map, &nmap);
        if (error)
                return error;
 
@@ -2086,8 +2085,7 @@ xfs_da_grow_inode_int(
                        error = xfs_bmapi_write(tp, dp, b, c,
                                        xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
                                        args->firstblock, args->total,
-                                       &mapp[mapi], &nmap,
-                                       args->trans->t_dfops);
+                                       &mapp[mapi], &nmap);
                        if (error)
                                goto out_free_map;
                        if (nmap < 1)
index 4a698dab85d2336c815941d3302f1c3ad465dd95..cf54da3187d55cd08602da9937b4a73d79f49941 100644 (file)
@@ -976,7 +976,7 @@ xfs_alloc_file_space(
                tp->t_dfops = &dfops;
                error = xfs_bmapi_write(tp, ip, startoffset_fsb,
                                        allocatesize_fsb, alloc_type, &firstfsb,
-                                       resblks, imapp, &nimaps, tp->t_dfops);
+                                       resblks, imapp, &nimaps);
                if (error)
                        goto error0;
 
index aa62f8b17376568575f4b87c95abadcc8033503c..1ef38e1df679971ff6877e0caaa3f26309b33af0 100644 (file)
@@ -313,7 +313,7 @@ xfs_dquot_disk_alloc(
        error = xfs_bmapi_write(tp, quotip, dqp->q_fileoffset,
                        XFS_DQUOT_CLUSTER_SIZE_FSB, XFS_BMAPI_METADATA,
                        &firstblock, XFS_QM_DQALLOC_SPACE_RES(mp),
-                       &map, &nmaps, tp->t_dfops);
+                       &map, &nmaps);
        if (error)
                goto error0;
        ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);
index 7c0b858f6723733776235f68f8a0947afa471c1f..0c736c938f5222b76dcff0429ce81bb5c38f235f 100644 (file)
@@ -259,7 +259,7 @@ xfs_iomap_write_direct(
        nimaps = 1;
        error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
                                bmapi_flags, &firstfsb, resblks, imap,
-                               &nimaps, tp->t_dfops);
+                               &nimaps);
        if (error)
                goto out_bmap_cancel;
 
@@ -773,8 +773,7 @@ xfs_iomap_write_allocate(
                         */
                        error = xfs_bmapi_write(tp, ip, map_start_fsb,
                                                count_fsb, flags, &first_block,
-                                               nres, imap, &nimaps,
-                                               tp->t_dfops);
+                                               nres, imap, &nimaps);
                        if (error)
                                goto trans_cancel;
 
@@ -884,7 +883,7 @@ xfs_iomap_write_unwritten(
                nimaps = 1;
                error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
                                        XFS_BMAPI_CONVERT, &firstfsb, resblks,
-                                       &imap, &nimaps, tp->t_dfops);
+                                       &imap, &nimaps);
                if (error)
                        goto error_on_bmapi_transaction;
 
index 3c28e7ff736561429bef38c9f4c44112ae120d97..9f3f144bf9fffcdd65d7cdfea316d148692626aa 100644 (file)
@@ -326,7 +326,7 @@ xfs_reflink_convert_cow_extent(
                return 0;
        return xfs_bmapi_write(NULL, ip, imap->br_startoff, imap->br_blockcount,
                        XFS_BMAPI_COWFORK | XFS_BMAPI_CONVERT, &first_block,
-                       0, imap, &nimaps, NULL);
+                       0, imap, &nimaps);
 }
 
 /* Convert all of the unwritten CoW extents in a file's range to real ones. */
@@ -349,8 +349,8 @@ xfs_reflink_convert_cow(
        xfs_ilock(ip, XFS_ILOCK_EXCL);
        error = xfs_bmapi_write(NULL, ip, offset_fsb, count_fsb,
                        XFS_BMAPI_COWFORK | XFS_BMAPI_CONVERT |
-                       XFS_BMAPI_CONVERT_ONLY, &first_block, 0, &imap, &nimaps,
-                       NULL);
+                       XFS_BMAPI_CONVERT_ONLY, &first_block, 0, &imap,
+                       &nimaps);
        xfs_iunlock(ip, XFS_ILOCK_EXCL);
        return error;
 }
@@ -435,7 +435,7 @@ retry:
        /* Allocate the entire reservation as unwritten blocks. */
        error = xfs_bmapi_write(tp, ip, imap->br_startoff, imap->br_blockcount,
                        XFS_BMAPI_COWFORK | XFS_BMAPI_PREALLOC, &first_block,
-                       resblks, imap, &nimaps, tp->t_dfops);
+                       resblks, imap, &nimaps);
        if (error)
                goto out_bmap_cancel;
 
index 312d410d91fb93863a24aa0b9262fe78258b4fbc..1c7d1238ff3b57f070df54ad8e0042b397776ed4 100644 (file)
@@ -795,7 +795,7 @@ xfs_growfs_rt_alloc(
                nmap = 1;
                error = xfs_bmapi_write(tp, ip, oblocks, nblocks - oblocks,
                                        XFS_BMAPI_METADATA, &firstblock,
-                                       resblks, &map, &nmap, tp->t_dfops);
+                                       resblks, &map, &nmap);
                if (!error && nmap < 1)
                        error = -ENOSPC;
                if (error)
index 6825a31727d1e1722ac25d72367f6987563f3661..2b6bcfd39c14a1e14741d8c6d9437c9f724104bc 100644 (file)
@@ -291,7 +291,7 @@ xfs_symlink(
 
                error = xfs_bmapi_write(tp, ip, first_fsb, fs_blocks,
                                  XFS_BMAPI_METADATA, &first_block, resblks,
-                                 mval, &nmaps, tp->t_dfops);
+                                 mval, &nmaps);
                if (error)
                        goto out_bmap_cancel;