--- initial
+++ final
@@ -1,93 +1,93 @@
 int xfs_bui_recover(struct xfs_mount *mp, struct xfs_bui_log_item *buip, struct xfs_defer_ops *dfops) {
   int error = 0;
   unsigned int bui_type;
   struct xfs_map_extent *bmap;
   xfs_fsblock_t startblock_fsb;
   xfs_fsblock_t inode_fsb;
   xfs_filblks_t count;
   bool op_ok;
   struct xfs_bud_log_item *budp;
   enum xfs_bmap_intent_type type;
   int whichfork;
   xfs_exntst_t state;
   struct xfs_trans *tp;
   struct xfs_inode *ip = NULL;
   struct xfs_bmbt_irec irec;
   ASSERT(!test_bit(XFS_BUI_RECOVERED, &buip->bui_flags));
   /* Only one mapping operation per BUI... */
   if (buip->bui_format.bui_nextents != XFS_BUI_MAX_FAST_EXTENTS) {
     set_bit(XFS_BUI_RECOVERED, &buip->bui_flags);
     xfs_bui_release(buip);
     return -EIO;
   }
   /*
    * First check the validity of the extent described by the
    * BUI.  If anything is bad, then toss the BUI.
    */
   bmap = &buip->bui_format.bui_extents[0];
   startblock_fsb = XFS_BB_TO_FSB(mp, XFS_FSB_TO_DADDR(mp, bmap->me_startblock));
   inode_fsb = XFS_BB_TO_FSB(mp, XFS_FSB_TO_DADDR(mp, XFS_INO_TO_FSB(mp, bmap->me_owner)));
   switch (bmap->me_flags & XFS_BMAP_EXTENT_TYPE_MASK) {
   case XFS_BMAP_MAP:
   case XFS_BMAP_UNMAP: op_ok = true; break;
   default: op_ok = false; break;
   }
   if (!op_ok || startblock_fsb == 0 || bmap->me_len == 0 || inode_fsb == 0 || startblock_fsb >= mp->m_sb.sb_dblocks || bmap->me_len >= mp->m_sb.sb_agblocks || inode_fsb >= mp->m_sb.sb_dblocks || (bmap->me_flags & ~XFS_BMAP_EXTENT_FLAGS)) {
     /*
      * This will pull the BUI from the AIL and
      * free the memory associated with it.
      */
     set_bit(XFS_BUI_RECOVERED, &buip->bui_flags);
     xfs_bui_release(buip);
     return -EIO;
   }
   error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK), 0, 0, &tp);
   if (error) return error;
   /*
    * Recovery stashes all deferred ops during intent processing and
    * finishes them on completion. Transfer current dfops state to this
    * transaction and transfer the result back before we return.
    */
   xfs_defer_move(tp->t_dfops, dfops);
   budp = xfs_trans_get_bud(tp, buip);
   /* Grab the inode. */
   error = xfs_iget(mp, tp, bmap->me_owner, 0, XFS_ILOCK_EXCL, &ip);
   if (error) goto err_inode;
   if (VFS_I(ip)->i_nlink == 0) xfs_iflags_set(ip, XFS_IRECOVERY);
   /* Process deferred bmap item. */
   state = (bmap->me_flags & XFS_BMAP_EXTENT_UNWRITTEN) ? XFS_EXT_UNWRITTEN : XFS_EXT_NORM;
   whichfork = (bmap->me_flags & XFS_BMAP_EXTENT_ATTR_FORK) ? XFS_ATTR_FORK : XFS_DATA_FORK;
   bui_type = bmap->me_flags & XFS_BMAP_EXTENT_TYPE_MASK;
   switch (bui_type) {
   case XFS_BMAP_MAP:
   case XFS_BMAP_UNMAP: type = bui_type; break;
   default: error = -EFSCORRUPTED; goto err_inode;
   }
   xfs_trans_ijoin(tp, ip, 0);
   count = bmap->me_len;
   error = xfs_trans_log_finish_bmap_update(tp, budp, tp->t_dfops, type, ip, whichfork, bmap->me_startoff, bmap->me_startblock, &count, state);
   if (error) goto err_inode;
   if (count > 0) {
     ASSERT(type == XFS_BMAP_UNMAP);
     irec.br_startblock = bmap->me_startblock;
     irec.br_blockcount = count;
     irec.br_startoff = bmap->me_startoff;
     irec.br_state = state;
     error = xfs_bmap_unmap_extent(tp->t_mountp, tp->t_dfops, ip, &irec);
     if (error) goto err_inode;
   }
   set_bit(XFS_BUI_RECOVERED, &buip->bui_flags);
   xfs_defer_move(dfops, tp->t_dfops);
   error = xfs_trans_commit(tp);
   xfs_iunlock(ip, XFS_ILOCK_EXCL);
-  IRELE(ip);
+  xfs_irele(ip);
   return error;
 err_inode:
   xfs_defer_move(dfops, tp->t_dfops);
   xfs_trans_cancel(tp);
   if (ip) {
     xfs_iunlock(ip, XFS_ILOCK_EXCL);
-    IRELE(ip);
+    xfs_irele(ip);
   }
   return error;
 }<sep>@@
expression dp;
@@
-               IRELE(dp);
+               xfs_irele(dp);