xfs: xfs_bunmapi() does not need XFS_BMAPI_METADATA flag
authorDave Chinner <dchinner@redhat.com>
Wed, 29 Jul 2015 01:51:01 +0000 (11:51 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 29 Jul 2015 01:51:01 +0000 (11:51 +1000)
xfs_bunmapi() doesn't care what type of extent is being freed and
does not look at the XFS_BMAPI_METADATA flag at all. As such we can
remove the XFS_BMAPI_METADATA from all callers that use it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_attr_remote.c
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_dir2.c
fs/xfs/xfs_symlink.c

index 20de88d1bf86205d126d5e27b43298af9b836a79..707362eab7051d01b423aa2b77d5e6ce80f712f5 100644 (file)
@@ -594,9 +594,8 @@ xfs_attr_rmtval_remove(
 
                xfs_bmap_init(args->flist, args->firstblock);
                error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
-                                   XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
-                                   1, args->firstblock, args->flist,
-                                   &done);
+                                   XFS_BMAPI_ATTRFORK, 1, args->firstblock,
+                                   args->flist, &done);
                if (!error) {
                        error = xfs_bmap_finish(&args->trans, args->flist,
                                                &committed);
index 2385f8cd08ab9f1cdf19ad3a9a8473a5e4e34eb3..2ae91e89f6b4ad5e34fc7eb5a2b7eb2bb9773eea 100644 (file)
@@ -2351,8 +2351,8 @@ xfs_da_shrink_inode(
                 * the last block to the place we want to kill.
                 */
                error = xfs_bunmapi(tp, dp, dead_blkno, count,
-                                   xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
-                                   0, args->firstblock, args->flist, &done);
+                                   xfs_bmapi_aflag(w), 0, args->firstblock,
+                                   args->flist, &done);
                if (error == -ENOSPC) {
                        if (w != XFS_DATA_FORK)
                                break;
index a69fb3a1e16182ac9bd636fa9abb42150444cacb..e0ba97610f01dc5a2507fb639f9f0c86df400585 100644 (file)
@@ -674,25 +674,22 @@ xfs_dir2_shrink_inode(
        mp = dp->i_mount;
        tp = args->trans;
        da = xfs_dir2_db_to_da(args->geo, db);
-       /*
-        * Unmap the fsblock(s).
-        */
-       if ((error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount,
-                       XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
-                       &done))) {
+
+       /* Unmap the fsblock(s). */
+       error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0,
+                           args->firstblock, args->flist, &done);
+       if (error) {
                /*
-                * ENOSPC actually can happen if we're in a removename with
-                * no space reservation, and the resulting block removal
-                * would cause a bmap btree split or conversion from extents
-                * to btree.  This can only happen for un-fragmented
-                * directory blocks, since you need to be punching out
-                * the middle of an extent.
-                * In this case we need to leave the block in the file,
-                * and not binval it.
-                * So the block has to be in a consistent empty state
-                * and appropriately logged.
-                * We don't free up the buffer, the caller can tell it
-                * hasn't happened since it got an error back.
+                * ENOSPC actually can happen if we're in a removename with no
+                * space reservation, and the resulting block removal would
+                * cause a bmap btree split or conversion from extents to btree.
+                * This can only happen for un-fragmented directory blocks,
+                * since you need to be punching out the middle of an extent.
+                * In this case we need to leave the block in the file, and not
+                * binval it.  So the block has to be in a consistent empty
+                * state and appropriately logged.  We don't free up the buffer,
+                * the caller can tell it hasn't happened since it got an error
+                * back.
                 */
                return error;
        }
index 4be27b0210af863f3913f94b9b7134307a7c74ff..05c44bf51b5fe064603638d00248df1847b82278 100644 (file)
@@ -501,7 +501,7 @@ xfs_inactive_symlink_rmt(
        /*
         * Unmap the dead block(s) to the free_list.
         */
-       error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps,
+       error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps,
                            &first_block, &free_list, &done);
        if (error)
                goto error_bmap_cancel;