--- initial
+++ final
@@ -1,109 +1,109 @@
 int xfs_bmap_shift_extents(struct xfs_trans *tp, struct xfs_inode *ip, xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb, int *done, xfs_fileoff_t stop_fsb, xfs_fsblock_t *firstblock, struct xfs_defer_ops *dfops, enum shift_direction direction, int num_exts) {
   struct xfs_btree_cur *cur = NULL;
   struct xfs_bmbt_rec_host *gotp;
   struct xfs_bmbt_irec got;
   struct xfs_mount *mp = ip->i_mount;
   struct xfs_ifork *ifp;
   xfs_extnum_t nexts = 0;
   xfs_extnum_t current_ext;
   xfs_extnum_t total_extents;
   xfs_extnum_t stop_extent;
   int error = 0;
   int whichfork = XFS_DATA_FORK;
   int logflags = 0;
-  if (unlikely(XFS_TEST_ERROR((XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), mp, XFS_ERRTAG_BMAPIFORMAT, XFS_RANDOM_BMAPIFORMAT))) {
+  if (unlikely(XFS_TEST_ERROR((XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), mp, XFS_ERRTAG_BMAPIFORMAT))) {
     XFS_ERROR_REPORT("xfs_bmap_shift_extents", XFS_ERRLEVEL_LOW, mp);
     return -EFSCORRUPTED;
   }
   if (XFS_FORCED_SHUTDOWN(mp)) return -EIO;
   ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
   ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
   ASSERT(direction == SHIFT_LEFT || direction == SHIFT_RIGHT);
   ASSERT(*next_fsb != NULLFSBLOCK || direction == SHIFT_RIGHT);
   ifp = XFS_IFORK_PTR(ip, whichfork);
   if (!(ifp->if_flags & XFS_IFEXTENTS)) {
     /* Read in all the extents */
     error = xfs_iread_extents(tp, ip, whichfork);
     if (error) return error;
   }
   if (ifp->if_flags & XFS_IFBROOT) {
     cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
     cur->bc_private.b.firstblock = *firstblock;
     cur->bc_private.b.dfops = dfops;
     cur->bc_private.b.flags = 0;
   }
   /*
    * There may be delalloc extents in the data fork before the range we
    * are collapsing out, so we cannot use the count of real extents here.
    * Instead we have to calculate it from the incore fork.
    */
   total_extents = xfs_iext_count(ifp);
   if (total_extents == 0) {
     *done = 1;
     goto del_cursor;
   }
   /*
    * In case of first right shift, we need to initialize next_fsb
    */
   if (*next_fsb == NULLFSBLOCK) {
     gotp = xfs_iext_get_ext(ifp, total_extents - 1);
     xfs_bmbt_get_all(gotp, &got);
     *next_fsb = got.br_startoff;
     if (stop_fsb > *next_fsb) {
       *done = 1;
       goto del_cursor;
     }
   }
   /* Lookup the extent index at which we have to stop */
   if (direction == SHIFT_RIGHT) {
     gotp = xfs_iext_bno_to_ext(ifp, stop_fsb, &stop_extent);
     /* Make stop_extent exclusive of shift range */
     stop_extent--;
   } else
     stop_extent = total_extents;
   /*
    * Look up the extent index for the fsb where we start shifting. We can
    * henceforth iterate with current_ext as extent list changes are locked
    * out via ilock.
    *
    * gotp can be null in 2 cases: 1) if there are no extents or 2)
    * *next_fsb lies in a hole beyond which there are no extents. Either
    * way, we are done.
    */
   gotp = xfs_iext_bno_to_ext(ifp, *next_fsb, &current_ext);
   if (!gotp) {
     *done = 1;
     goto del_cursor;
   }
   /* some sanity checking before we finally start shifting extents */
   if ((direction == SHIFT_LEFT && current_ext >= stop_extent) || (direction == SHIFT_RIGHT && current_ext <= stop_extent)) {
     error = -EIO;
     goto del_cursor;
   }
   while (nexts++ < num_exts) {
     error = xfs_bmse_shift_one(ip, whichfork, offset_shift_fsb, &current_ext, gotp, cur, &logflags, direction, dfops);
     if (error) goto del_cursor;
     /*
      * If there was an extent merge during the shift, the extent
      * count can change. Update the total and grade the next record.
      */
     if (direction == SHIFT_LEFT) {
       total_extents = xfs_iext_count(ifp);
       stop_extent = total_extents;
     }
     if (current_ext == stop_extent) {
       *done = 1;
       *next_fsb = NULLFSBLOCK;
       break;
     }
     gotp = xfs_iext_get_ext(ifp, current_ext);
   }
   if (!*done) {
     xfs_bmbt_get_all(gotp, &got);
     *next_fsb = got.br_startoff;
   }
 del_cursor:
   if (cur) xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
   if (logflags) xfs_trans_log_inode(tp, ip, logflags);
   return error;
 }<sep>@@
expression e1,e2,e3,e4;
@@
XFS_TEST_ERROR(e1,e2,e3
-                      ,e4
   )