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);
 
                                                   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;
        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) {
                         * 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;
                        }
 
 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,
 
        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;
 
                        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)
 
                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;
 
 
        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);
 
        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;
 
                         */
                        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;
 
                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;
 
 
                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. */
        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;
 }
        /* 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;
 
 
                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)
 
 
                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;