imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,66 +1,66 @@
 STATIC int xfs_inactive_ifree(struct xfs_inode *ip) {
   struct xfs_defer_ops dfops;
   struct xfs_mount *mp = ip->i_mount;
   struct xfs_trans *tp;
   int error;
   /*
    * We try to use a per-AG reservation for any block needed by the finobt
    * tree, but as the finobt feature predates the per-AG reservation
    * support a degraded file system might not have enough space for the
    * reservation at mount time.  In that case try to dip into the reserved
    * pool and pray.
    *
    * Send a warning if the reservation does happen to fail, as the inode
    * now remains allocated and sits on the unlinked list until the fs is
    * repaired.
    */
   if (unlikely(mp->m_inotbt_nores)) {
     error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ifree, XFS_IFREE_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp);
   } else {
     error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ifree, 0, 0, 0, &tp);
   }
   if (error) {
     if (error == -ENOSPC) {
       xfs_warn_ratelimited(mp, "Failed to remove inode(s) from unlinked list. "
                                "Please free space, unmount and run xfs_repair.");
     } else {
       ASSERT(XFS_FORCED_SHUTDOWN(mp));
     }
     return error;
   }
   xfs_ilock(ip, XFS_ILOCK_EXCL);
   xfs_trans_ijoin(tp, ip, 0);
-  xfs_defer_init(tp, &dfops, &tp->t_firstblock);
+  xfs_defer_init(tp, &dfops);
   error = xfs_ifree(tp, ip);
   if (error) {
     /*
      * If we fail to free the inode, shut down.  The cancel
      * might do that, we need to make sure.  Otherwise the
      * inode might be lost for a long time or forever.
      */
     if (!XFS_FORCED_SHUTDOWN(mp)) {
       xfs_notice(mp, "%s: xfs_ifree returned error %d", __func__, error);
       xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
     }
     xfs_trans_cancel(tp);
     xfs_iunlock(ip, XFS_ILOCK_EXCL);
     return error;
   }
   /*
    * Credit the quota account(s). The inode is gone.
    */
   xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_ICOUNT, -1);
   /*
    * Just ignore errors at this point.  There is nothing we can do except
    * to try to keep going. Make sure it's not a silent error.
    */
   error = xfs_defer_finish(&tp, &dfops);
   if (error) {
     xfs_notice(mp, "%s: xfs_defer_finish returned error %d", __func__, error);
     xfs_defer_cancel(&dfops);
   }
   error = xfs_trans_commit(tp);
   if (error) xfs_notice(mp, "%s: xfs_trans_commit returned error %d", __func__, error);
   xfs_iunlock(ip, XFS_ILOCK_EXCL);
   return 0;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,73 +1,73 @@
 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_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(tp, &dfops, &tp->t_firstblock);
+    xfs_defer_init(tp, &dfops);
     error = xfs_bunmapi(tp, ip, first_unmap_block, unmap_len, flags, XFS_ITRUNC_MAX_EXTENTS, &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,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,67 +1,67 @@
 int xfs_link(xfs_inode_t *tdp, xfs_inode_t *sip, struct xfs_name *target_name) {
   xfs_mount_t *mp = tdp->i_mount;
   xfs_trans_t *tp;
   int error;
   struct xfs_defer_ops dfops;
   int resblks;
   trace_xfs_link(tdp, target_name);
   ASSERT(!S_ISDIR(VFS_I(sip)->i_mode));
   if (XFS_FORCED_SHUTDOWN(mp)) return -EIO;
   error = xfs_qm_dqattach(sip);
   if (error) goto std_return;
   error = xfs_qm_dqattach(tdp);
   if (error) goto std_return;
   resblks = XFS_LINK_SPACE_RES(mp, target_name->len);
   error = xfs_trans_alloc(mp, &M_RES(mp)->tr_link, resblks, 0, 0, &tp);
   if (error == -ENOSPC) {
     resblks = 0;
     error = xfs_trans_alloc(mp, &M_RES(mp)->tr_link, 0, 0, 0, &tp);
   }
   if (error) goto std_return;
   xfs_lock_two_inodes(sip, XFS_ILOCK_EXCL, tdp, XFS_ILOCK_EXCL);
   xfs_trans_ijoin(tp, sip, XFS_ILOCK_EXCL);
   xfs_trans_ijoin(tp, tdp, XFS_ILOCK_EXCL);
   /*
    * If we are using project inheritance, we only allow hard link
    * creation in our tree when the project IDs are the same; else
    * the tree quota mechanism could be circumvented.
    */
   if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && (xfs_get_projid(tdp) != xfs_get_projid(sip)))) {
     error = -EXDEV;
     goto error_return;
   }
   if (!resblks) {
     error = xfs_dir_canenter(tp, tdp, target_name);
     if (error) goto error_return;
   }
-  xfs_defer_init(tp, &dfops, &tp->t_firstblock);
+  xfs_defer_init(tp, &dfops);
   /*
    * Handle initial link state of O_TMPFILE inode
    */
   if (VFS_I(sip)->i_nlink == 0) {
     error = xfs_iunlink_remove(tp, sip);
     if (error) goto error_return;
   }
   error = xfs_dir_createname(tp, tdp, target_name, sip->i_ino, resblks);
   if (error) goto error_return;
   xfs_trans_ichgtime(tp, tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
   xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
   error = xfs_bumplink(tp, sip);
   if (error) goto error_return;
   /*
    * If this is a synchronous mount, make sure that the
    * link transaction goes to disk before returning to
    * the user.
    */
   if (mp->m_flags & (XFS_MOUNT_WSYNC | XFS_MOUNT_DIRSYNC)) xfs_trans_set_sync(tp);
   error = xfs_defer_finish(&tp, &dfops);
   if (error) {
     xfs_defer_cancel(&dfops);
     goto error_return;
   }
   return xfs_trans_commit(tp);
 error_return:
   xfs_trans_cancel(tp);
 std_return:
   return error;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,59 +1,59 @@
 STATIC int xlog_recover_process_intents(struct xlog *log) {
   struct xfs_defer_ops dfops;
   struct xfs_ail_cursor cur;
   struct xfs_log_item *lip;
   struct xfs_ail *ailp;
   xfs_fsblock_t firstfsb;
   int error = 0;
 #if defined(DEBUG) || defined(XFS_WARN)
   xfs_lsn_t last_lsn;
 #endif
   ailp = log->l_ailp;
   spin_lock(&ailp->ail_lock);
   lip = xfs_trans_ail_cursor_first(ailp, &cur, 0);
 #if defined(DEBUG) || defined(XFS_WARN)
   last_lsn = xlog_assign_lsn(log->l_curr_cycle, log->l_curr_block);
 #endif
-  xfs_defer_init(NULL, &dfops, &firstfsb);
+  xfs_defer_init(NULL, &dfops);
   while (lip != NULL) {
     /*
      * We're done when we see something other than an intent.
      * There should be no intents left in the AIL now.
      */
     if (!xlog_item_is_intent(lip)) {
 #ifdef DEBUG
       for (; lip; lip = xfs_trans_ail_cursor_next(ailp, &cur))
         ASSERT(!xlog_item_is_intent(lip));
 #endif
       break;
     }
     /*
      * We should never see a redo item with a LSN higher than
      * the last transaction we found in the log at the start
      * of recovery.
      */
     ASSERT(XFS_LSN_CMP(last_lsn, lip->li_lsn) >= 0);
     /*
      * NOTE: If your intent processing routine can create more
      * deferred ops, you /must/ attach them to the dfops in this
      * routine or else those subsequent intents will get
      * replayed in the wrong order!
      */
     switch (lip->li_type) {
     case XFS_LI_EFI: error = xlog_recover_process_efi(log->l_mp, ailp, lip); break;
     case XFS_LI_RUI: error = xlog_recover_process_rui(log->l_mp, ailp, lip); break;
     case XFS_LI_CUI: error = xlog_recover_process_cui(log->l_mp, ailp, lip, &dfops); break;
     case XFS_LI_BUI: error = xlog_recover_process_bui(log->l_mp, ailp, lip, &dfops); break;
     }
     if (error) goto out;
     lip = xfs_trans_ail_cursor_next(ailp, &cur);
   }
 out:
   xfs_trans_ail_cursor_done(&cur);
   spin_unlock(&ailp->ail_lock);
   if (error)
     xfs_defer_cancel(&dfops);
   else
     error = xlog_finish_defer_ops(log->l_mp, &dfops);
   return error;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,81 +1,81 @@
 int xfs_refcount_recover_cow_leftovers(struct xfs_mount *mp, xfs_agnumber_t agno) {
   struct xfs_trans *tp;
   struct xfs_btree_cur *cur;
   struct xfs_buf *agbp;
   struct xfs_refcount_recovery *rr, *n;
   struct list_head debris;
   union xfs_btree_irec low;
   union xfs_btree_irec high;
   struct xfs_defer_ops dfops;
   xfs_fsblock_t fsb;
   xfs_agblock_t agbno;
   int error;
   if (mp->m_sb.sb_agblocks >= XFS_REFC_COW_START) return -EOPNOTSUPP;
   INIT_LIST_HEAD(&debris);
   /*
    * In this first part, we use an empty transaction to gather up
    * all the leftover CoW extents so that we can subsequently
    * delete them.  The empty transaction is used to avoid
    * a buffer lock deadlock if there happens to be a loop in the
    * refcountbt because we're allowed to re-grab a buffer that is
    * already attached to our transaction.  When we're done
    * recording the CoW debris we cancel the (empty) transaction
    * and everything goes away cleanly.
    */
   error = xfs_trans_alloc_empty(mp, &tp);
   if (error) return error;
   error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp);
   if (error) goto out_trans;
   if (!agbp) {
     error = -ENOMEM;
     goto out_trans;
   }
   cur = xfs_refcountbt_init_cursor(mp, tp, agbp, agno);
   /* Find all the leftover CoW staging extents. */
   memset(&low, 0, sizeof(low));
   memset(&high, 0, sizeof(high));
   low.rc.rc_startblock = XFS_REFC_COW_START;
   high.rc.rc_startblock = -1U;
   error = xfs_btree_query_range(cur, &low, &high, xfs_refcount_recover_extent, &debris);
   if (error) goto out_cursor;
   xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);
   xfs_trans_brelse(tp, agbp);
   xfs_trans_cancel(tp);
   /* Now iterate the list to free the leftovers */
   list_for_each_entry_safe(rr, n, &debris, rr_list) {
     /* Set up transaction. */
     error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp);
     if (error) goto out_free;
     trace_xfs_refcount_recover_extent(mp, agno, &rr->rr_rrec);
     /* Free the orphan record */
-    xfs_defer_init(tp, &dfops, &tp->t_firstblock);
+    xfs_defer_init(tp, &dfops);
     agbno = rr->rr_rrec.rc_startblock - XFS_REFC_COW_START;
     fsb = XFS_AGB_TO_FSB(mp, agno, agbno);
     error = xfs_refcount_free_cow_extent(mp, tp->t_dfops, fsb, rr->rr_rrec.rc_blockcount);
     if (error) goto out_defer;
     /* Free the block. */
     xfs_bmap_add_free(mp, tp->t_dfops, fsb, rr->rr_rrec.rc_blockcount, NULL);
     error = xfs_defer_finish(&tp, tp->t_dfops);
     if (error) goto out_defer;
     error = xfs_trans_commit(tp);
     if (error) goto out_free;
     list_del(&rr->rr_list);
     kmem_free(rr);
   }
   return error;
 out_defer:
   xfs_defer_cancel(tp->t_dfops);
 out_trans:
   xfs_trans_cancel(tp);
 out_free:
   /* Free the leftover list */
   list_for_each_entry_safe(rr, n, &debris, rr_list) {
     list_del(&rr->rr_list);
     kmem_free(rr);
   }
   return error;
 out_cursor:
   xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
   xfs_trans_brelse(tp, agbp);
   goto out_trans;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,72 +1,72 @@
 int xfs_reflink_allocate_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap, bool *shared, uint *lockmode) {
   struct xfs_mount *mp = ip->i_mount;
   xfs_fileoff_t offset_fsb = imap->br_startoff;
   xfs_filblks_t count_fsb = imap->br_blockcount;
   struct xfs_bmbt_irec got;
   struct xfs_defer_ops dfops;
   struct xfs_trans *tp = NULL;
   int nimaps, error = 0;
   bool trimmed;
   xfs_filblks_t resaligned;
   xfs_extlen_t resblks = 0;
   struct xfs_iext_cursor icur;
 retry:
   ASSERT(xfs_is_reflink_inode(ip));
   ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
   /*
    * Even if the extent is not shared we might have a preallocation for
    * it in the COW fork.  If so use it.
    */
   if (xfs_iext_lookup_extent(ip, ip->i_cowfp, offset_fsb, &icur, &got) && got.br_startoff <= offset_fsb) {
     *shared = true;
     /* If we have a real allocation in the COW fork we're done. */
     if (!isnullstartblock(got.br_startblock)) {
       xfs_trim_extent(&got, offset_fsb, count_fsb);
       *imap = got;
       goto convert;
     }
     xfs_trim_extent(imap, got.br_startoff, got.br_blockcount);
   } else {
     error = xfs_reflink_trim_around_shared(ip, imap, shared, &trimmed);
     if (error || !*shared) goto out;
   }
   if (!tp) {
     resaligned = xfs_aligned_fsb_count(imap->br_startoff, imap->br_blockcount, xfs_get_cowextsz_hint(ip));
     resblks = XFS_DIOSTRAT_SPACE_RES(mp, resaligned);
     xfs_iunlock(ip, *lockmode);
     error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0, 0, &tp);
     *lockmode = XFS_ILOCK_EXCL;
     xfs_ilock(ip, *lockmode);
     if (error) return error;
     error = xfs_qm_dqattach_locked(ip, false);
     if (error) goto out;
     goto retry;
   }
   error = xfs_trans_reserve_quota_nblks(tp, ip, resblks, 0, XFS_QMOPT_RES_REGBLKS);
   if (error) goto out;
   xfs_trans_ijoin(tp, ip, 0);
-  xfs_defer_init(tp, &dfops, &tp->t_firstblock);
+  xfs_defer_init(tp, &dfops);
   nimaps = 1;
   /* 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, resblks, imap, &nimaps);
   if (error) goto out_bmap_cancel;
   xfs_inode_set_cowblocks_tag(ip);
   /* Finish up. */
   error = xfs_defer_finish(&tp, tp->t_dfops);
   if (error) goto out_bmap_cancel;
   error = xfs_trans_commit(tp);
   if (error) return error;
   /*
    * Allocation succeeded but the requested range was not even partially
    * satisfied?  Bail out!
    */
   if (nimaps == 0) return -ENOSPC;
 convert:
   return xfs_reflink_convert_cow_extent(ip, imap, offset_fsb, count_fsb);
 out_bmap_cancel:
   xfs_defer_cancel(tp->t_dfops);
   xfs_trans_unreserve_quota_nblks(tp, ip, (long)resblks, 0, XFS_QMOPT_RES_REGBLKS);
 out:
   if (tp) xfs_trans_cancel(tp);
   return error;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,52 +1,52 @@
 int xfs_reflink_cancel_cow_blocks(struct xfs_inode *ip, struct xfs_trans **tpp, xfs_fileoff_t offset_fsb, xfs_fileoff_t end_fsb, bool cancel_real) {
   struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
   struct xfs_bmbt_irec got, del;
   struct xfs_iext_cursor icur;
   struct xfs_defer_ops dfops;
   struct xfs_defer_ops *odfops = (*tpp)->t_dfops;
   int error = 0;
   if (!xfs_is_reflink_inode(ip)) return 0;
   if (!xfs_iext_lookup_extent_before(ip, ifp, &end_fsb, &icur, &got)) return 0;
   /* Walk backwards until we're out of the I/O range... */
   while (got.br_startoff + got.br_blockcount > offset_fsb) {
     del = got;
     xfs_trim_extent(&del, offset_fsb, end_fsb - offset_fsb);
     /* Extent delete may have bumped ext forward */
     if (!del.br_blockcount) {
       xfs_iext_prev(ifp, &icur);
       goto next_extent;
     }
     trace_xfs_reflink_cancel_cow(ip, &del);
     if (isnullstartblock(del.br_startblock)) {
       error = xfs_bmap_del_extent_delay(ip, XFS_COW_FORK, &icur, &got, &del);
       if (error) break;
     } else if (del.br_state == XFS_EXT_UNWRITTEN || cancel_real) {
-      xfs_defer_init(*tpp, &dfops, &(*tpp)->t_firstblock);
+      xfs_defer_init(*tpp, &dfops);
       /* Free the CoW orphan record. */
       error = xfs_refcount_free_cow_extent(ip->i_mount, (*tpp)->t_dfops, del.br_startblock, del.br_blockcount);
       if (error) break;
       xfs_bmap_add_free(ip->i_mount, (*tpp)->t_dfops, del.br_startblock, del.br_blockcount, NULL);
       /* Roll the transaction */
       xfs_defer_ijoin((*tpp)->t_dfops, ip);
       error = xfs_defer_finish(tpp, (*tpp)->t_dfops);
       if (error) {
         xfs_defer_cancel((*tpp)->t_dfops);
         break;
       }
       /* Remove the mapping from the CoW fork. */
       xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
       /* Remove the quota reservation */
       error = xfs_trans_reserve_quota_nblks(NULL, ip, -(long)del.br_blockcount, 0, XFS_QMOPT_RES_REGBLKS);
       if (error) break;
     } else {
       /* Didn't do anything, push cursor back. */
       xfs_iext_prev(ifp, &icur);
     }
   next_extent:
     if (!xfs_iext_get_extent(ifp, &icur, &got)) break;
   }
   /* clear tag if cow fork is emptied */
   if (!ifp->if_bytes) xfs_inode_clear_cowblocks_tag(ip);
   (*tpp)->t_dfops = odfops;
   return error;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,89 +1,89 @@
 STATIC int xfs_inactive_symlink_rmt(struct xfs_inode *ip) {
   xfs_buf_t *bp;
   int done;
   int error;
   struct xfs_defer_ops dfops;
   int i;
   xfs_mount_t *mp;
   xfs_bmbt_irec_t mval[XFS_SYMLINK_MAPS];
   int nmaps;
   int size;
   xfs_trans_t *tp;
   mp = ip->i_mount;
   ASSERT(ip->i_df.if_flags & XFS_IFEXTENTS);
   /*
    * We're freeing a symlink that has some
    * blocks allocated to it.  Free the
    * blocks here.  We know that we've got
    * either 1 or 2 extents and that we can
    * free them all in one bunmapi call.
    */
   ASSERT(ip->i_d.di_nextents > 0 && ip->i_d.di_nextents <= 2);
   error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp);
   if (error) return error;
   xfs_ilock(ip, XFS_ILOCK_EXCL);
   xfs_trans_ijoin(tp, ip, 0);
   /*
    * Lock the inode, fix the size, and join it to the transaction.
    * Hold it so in the normal path, we still have it locked for
    * the second transaction.  In the error paths we need it
    * held so the cancel won't rele it, see below.
    */
   size = (int)ip->i_d.di_size;
   ip->i_d.di_size = 0;
   xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
   /*
    * Find the block(s) so we can inval and unmap them.
    */
   done = 0;
-  xfs_defer_init(tp, &dfops, &tp->t_firstblock);
+  xfs_defer_init(tp, &dfops);
   nmaps = ARRAY_SIZE(mval);
   error = xfs_bmapi_read(ip, 0, xfs_symlink_blocks(mp, size), mval, &nmaps, 0);
   if (error) goto error_trans_cancel;
   /*
    * Invalidate the block(s). No validation is done.
    */
   for (i = 0; i < nmaps; i++) {
     bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, XFS_FSB_TO_DADDR(mp, mval[i].br_startblock), XFS_FSB_TO_BB(mp, mval[i].br_blockcount), 0);
     if (!bp) {
       error = -ENOMEM;
       goto error_bmap_cancel;
     }
     xfs_trans_binval(tp, bp);
   }
   /*
    * Unmap the dead block(s) to the dfops.
    */
   error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps, &done);
   if (error) goto error_bmap_cancel;
   ASSERT(done);
   /*
    * Commit the first transaction.  This logs the EFI and the inode.
    */
   xfs_defer_ijoin(tp->t_dfops, ip);
   error = xfs_defer_finish(&tp, tp->t_dfops);
   if (error) goto error_bmap_cancel;
   /*
    * Commit the transaction containing extent freeing and EFDs.
    */
   xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
   error = xfs_trans_commit(tp);
   if (error) {
     ASSERT(XFS_FORCED_SHUTDOWN(mp));
     goto error_unlock;
   }
   /*
    * Remove the memory for extent descriptions (just bookkeeping).
    */
   if (ip->i_df.if_bytes) xfs_idata_realloc(ip, -ip->i_df.if_bytes, XFS_DATA_FORK);
   ASSERT(ip->i_df.if_bytes == 0);
   xfs_iunlock(ip, XFS_ILOCK_EXCL);
   return 0;
 error_bmap_cancel:
   xfs_defer_cancel(tp->t_dfops);
 error_trans_cancel:
   xfs_trans_cancel(tp);
 error_unlock:
   xfs_iunlock(ip, XFS_ILOCK_EXCL);
   return error;
 }<sep>@@
expression e1,e2,e3;
@@
  xfs_defer_init(e1,e2
- 		, e3
	)
--- initial
+++ final
@@ -1,45 +1,45 @@
 int i915_gem_huge_page_mock_selftests(void) {
   static const struct i915_subtest tests[] = {
       SUBTEST(igt_mock_exhaust_device_supported_pages),
       SUBTEST(igt_mock_ppgtt_misaligned_dma),
       SUBTEST(igt_mock_ppgtt_huge_fill),
       SUBTEST(igt_mock_ppgtt_64K),
   };
   int saved_ppgtt = i915_modparams.enable_ppgtt;
   struct drm_i915_private *dev_priv;
   struct pci_dev *pdev;
   struct i915_hw_ppgtt *ppgtt;
   int err;
   dev_priv = mock_gem_device();
   if (!dev_priv) return -ENOMEM;
   /* Pretend to be a device which supports the 48b PPGTT */
   i915_modparams.enable_ppgtt = 3;
   pdev = dev_priv->drm.pdev;
   dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(39));
   mutex_lock(&dev_priv->drm.struct_mutex);
   ppgtt = i915_ppgtt_create(dev_priv, ERR_PTR(-ENODEV), "mock");
   if (IS_ERR(ppgtt)) {
     err = PTR_ERR(ppgtt);
     goto out_unlock;
   }
   if (!i915_vm_is_48bit(&ppgtt->vm)) {
     pr_err("failed to create 48b PPGTT\n");
     err = -EINVAL;
     goto out_close;
   }
   /* If we were ever hit this then it's time to mock the 64K scratch */
   if (!i915_vm_has_scratch_64K(&ppgtt->vm)) {
     pr_err("PPGTT missing 64K scratch page\n");
     err = -EINVAL;
     goto out_close;
   }
   err = i915_subtests(tests, ppgtt);
 out_close:
   i915_ppgtt_close(&ppgtt->vm);
   i915_ppgtt_put(ppgtt);
 out_unlock:
   mutex_unlock(&dev_priv->drm.struct_mutex);
   i915_modparams.enable_ppgtt = saved_ppgtt;
-  drm_dev_unref(&dev_priv->drm);
+  drm_dev_put(&dev_priv->drm);
   return err;
 }<sep>@@
expression e;
@@

-       drm_dev_unref
+       drm_dev_put
           (e)
--- initial
+++ final
@@ -1,12 +1,12 @@
 int i915_gem_context_mock_selftests(void) {
   static const struct i915_subtest tests[] = {
       SUBTEST(igt_switch_to_kernel_context),
   };
   struct drm_i915_private *i915;
   int err;
   i915 = mock_gem_device();
   if (!i915) return -ENOMEM;
   err = i915_subtests(tests, i915);
-  drm_dev_unref(&i915->drm);
+  drm_dev_put(&i915->drm);
   return err;
 }<sep>@@
expression e;
@@

-       drm_dev_unref
+       drm_dev_put
           (e)