--- initial
+++ final
@@ -1,75 +1,74 @@
 int xfs_itruncate_extents_flags(struct xfs_trans **tpp, struct xfs_inode *ip, int whichfork, xfs_fsize_t new_size, int flags) {
   struct xfs_mount *mp = ip->i_mount;
   struct xfs_trans *tp = *tpp;
   struct xfs_defer_ops *odfops = tp->t_dfops;
   struct xfs_defer_ops dfops;
   xfs_fsblock_t first_block;
   xfs_fileoff_t first_unmap_block;
   xfs_fileoff_t last_block;
   xfs_filblks_t unmap_len;
   int error = 0;
   int done = 0;
   ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
   ASSERT(!atomic_read(&VFS_I(ip)->i_count) || xfs_isilocked(ip, XFS_IOLOCK_EXCL));
   ASSERT(new_size <= XFS_ISIZE(ip));
   ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
   ASSERT(ip->i_itemp != NULL);
   ASSERT(ip->i_itemp->ili_lock_flags == 0);
   ASSERT(!XFS_NOT_DQATTACHED(mp, ip));
   trace_xfs_itruncate_extents_start(ip, new_size);
   flags |= xfs_bmapi_aflag(whichfork);
   /*
    * Since it is possible for space to become allocated beyond
    * the end of the file (in a crash where the space is allocated
    * but the inode size is not yet updated), simply remove any
    * blocks which show up between the new EOF and the maximum
    * possible file size.  If the first block to be removed is
    * beyond the maximum file size (ie it is the same as last_block),
    * then there is nothing to do.
    */
   first_unmap_block = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size);
   last_block = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
   if (first_unmap_block == last_block) return 0;
   ASSERT(first_unmap_block < last_block);
   unmap_len = last_block - first_unmap_block + 1;
   while (!done) {
-    xfs_defer_init(&dfops, &first_block);
-    tp->t_dfops = &dfops;
+    xfs_defer_init(tp, &dfops, &first_block);
     error = xfs_bunmapi(tp, ip, first_unmap_block, unmap_len, flags, XFS_ITRUNC_MAX_EXTENTS, &first_block, &done);
     if (error) goto out_bmap_cancel;
     /*
      * Duplicate the transaction that has the permanent
      * reservation and commit the old transaction.
      */
     xfs_defer_ijoin(tp->t_dfops, ip);
     error = xfs_defer_finish(&tp, tp->t_dfops);
     if (error) goto out_bmap_cancel;
     error = xfs_trans_roll_inode(&tp, ip);
     if (error) goto out;
   }
   if (whichfork == XFS_DATA_FORK) {
     /* Remove all pending CoW reservations. */
     error = xfs_reflink_cancel_cow_blocks(ip, &tp, first_unmap_block, last_block, true);
     if (error) goto out;
     xfs_itruncate_clear_reflink_flags(ip);
   }
   /*
    * Always re-log the inode so that our permanent transaction can keep
    * on rolling it forward in the log.
    */
   xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
   trace_xfs_itruncate_extents_end(ip, new_size);
 out:
   /* ->t_dfops points to local stack, don't leak it! */
   tp->t_dfops = odfops;
   *tpp = tp;
   return error;
 out_bmap_cancel:
   /*
    * If the bunmapi call encounters an error, return to the caller where
    * the transaction can be properly aborted.  We just need to make sure
    * we're not holding any resources that we were not when we came in.
    */
   xfs_defer_cancel(tp->t_dfops);
   goto out;
 }<sep>@@
expression e1,e2,tp;
@@

-		xfs_defer_init(e1, e2);
-		(tp)->t_dfops = e1;
+		xfs_defer_init(tp, e1, e2);