aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2015-07-28 21:51:01 -0400
committerDave Chinner <david@fromorbit.com>2015-07-28 21:51:01 -0400
commitab7bb61092308e83130b8d15725aee1672991d65 (patch)
treeb80c7f326f75c50f42e26a75466ed84f8edb6850
parentbc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff)
xfs: xfs_bunmapi() does not need XFS_BMAPI_METADATA flag
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>
-rw-r--r--fs/xfs/libxfs/xfs_attr_remote.c5
-rw-r--r--fs/xfs/libxfs/xfs_da_btree.c4
-rw-r--r--fs/xfs/libxfs/xfs_dir2.c33
-rw-r--r--fs/xfs/xfs_symlink.c2
4 files changed, 20 insertions, 24 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index 20de88d1bf86..707362eab705 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -594,9 +594,8 @@ xfs_attr_rmtval_remove(
594 594
595 xfs_bmap_init(args->flist, args->firstblock); 595 xfs_bmap_init(args->flist, args->firstblock);
596 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, 596 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
597 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 597 XFS_BMAPI_ATTRFORK, 1, args->firstblock,
598 1, args->firstblock, args->flist, 598 args->flist, &done);
599 &done);
600 if (!error) { 599 if (!error) {
601 error = xfs_bmap_finish(&args->trans, args->flist, 600 error = xfs_bmap_finish(&args->trans, args->flist,
602 &committed); 601 &committed);
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
index 2385f8cd08ab..2ae91e89f6b4 100644
--- a/fs/xfs/libxfs/xfs_da_btree.c
+++ b/fs/xfs/libxfs/xfs_da_btree.c
@@ -2351,8 +2351,8 @@ xfs_da_shrink_inode(
2351 * the last block to the place we want to kill. 2351 * the last block to the place we want to kill.
2352 */ 2352 */
2353 error = xfs_bunmapi(tp, dp, dead_blkno, count, 2353 error = xfs_bunmapi(tp, dp, dead_blkno, count,
2354 xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, 2354 xfs_bmapi_aflag(w), 0, args->firstblock,
2355 0, args->firstblock, args->flist, &done); 2355 args->flist, &done);
2356 if (error == -ENOSPC) { 2356 if (error == -ENOSPC) {
2357 if (w != XFS_DATA_FORK) 2357 if (w != XFS_DATA_FORK)
2358 break; 2358 break;
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c
index a69fb3a1e161..e0ba97610f01 100644
--- a/fs/xfs/libxfs/xfs_dir2.c
+++ b/fs/xfs/libxfs/xfs_dir2.c
@@ -674,25 +674,22 @@ xfs_dir2_shrink_inode(
674 mp = dp->i_mount; 674 mp = dp->i_mount;
675 tp = args->trans; 675 tp = args->trans;
676 da = xfs_dir2_db_to_da(args->geo, db); 676 da = xfs_dir2_db_to_da(args->geo, db);
677 /* 677
678 * Unmap the fsblock(s). 678 /* Unmap the fsblock(s). */
679 */ 679 error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0,
680 if ((error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 680 args->firstblock, args->flist, &done);
681 XFS_BMAPI_METADATA, 0, args->firstblock, args->flist, 681 if (error) {
682 &done))) {
683 /* 682 /*
684 * ENOSPC actually can happen if we're in a removename with 683 * ENOSPC actually can happen if we're in a removename with no
685 * no space reservation, and the resulting block removal 684 * space reservation, and the resulting block removal would
686 * would cause a bmap btree split or conversion from extents 685 * cause a bmap btree split or conversion from extents to btree.
687 * to btree. This can only happen for un-fragmented 686 * This can only happen for un-fragmented directory blocks,
688 * directory blocks, since you need to be punching out 687 * since you need to be punching out the middle of an extent.
689 * the middle of an extent. 688 * In this case we need to leave the block in the file, and not
690 * In this case we need to leave the block in the file, 689 * binval it. So the block has to be in a consistent empty
691 * and not binval it. 690 * state and appropriately logged. We don't free up the buffer,
692 * So the block has to be in a consistent empty state 691 * the caller can tell it hasn't happened since it got an error
693 * and appropriately logged. 692 * back.
694 * We don't free up the buffer, the caller can tell it
695 * hasn't happened since it got an error back.
696 */ 693 */
697 return error; 694 return error;
698 } 695 }
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 4be27b0210af..05c44bf51b5f 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -501,7 +501,7 @@ xfs_inactive_symlink_rmt(
501 /* 501 /*
502 * Unmap the dead block(s) to the free_list. 502 * Unmap the dead block(s) to the free_list.
503 */ 503 */
504 error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps, 504 error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps,
505 &first_block, &free_list, &done); 505 &first_block, &free_list, &done);
506 if (error) 506 if (error)
507 goto error_bmap_cancel; 507 goto error_bmap_cancel;