提交 ab7bb610 编写于 作者: D Dave Chinner 提交者: Dave Chinner

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: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 bc0195aa
...@@ -594,9 +594,8 @@ xfs_attr_rmtval_remove( ...@@ -594,9 +594,8 @@ xfs_attr_rmtval_remove(
xfs_bmap_init(args->flist, args->firstblock); xfs_bmap_init(args->flist, args->firstblock);
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, XFS_BMAPI_ATTRFORK, 1, args->firstblock,
1, args->firstblock, args->flist, args->flist, &done);
&done);
if (!error) { if (!error) {
error = xfs_bmap_finish(&args->trans, args->flist, error = xfs_bmap_finish(&args->trans, args->flist,
&committed); &committed);
......
...@@ -2351,8 +2351,8 @@ xfs_da_shrink_inode( ...@@ -2351,8 +2351,8 @@ xfs_da_shrink_inode(
* the last block to the place we want to kill. * the last block to the place we want to kill.
*/ */
error = xfs_bunmapi(tp, dp, dead_blkno, count, error = xfs_bunmapi(tp, dp, dead_blkno, count,
xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, xfs_bmapi_aflag(w), 0, args->firstblock,
0, args->firstblock, args->flist, &done); args->flist, &done);
if (error == -ENOSPC) { if (error == -ENOSPC) {
if (w != XFS_DATA_FORK) if (w != XFS_DATA_FORK)
break; break;
......
...@@ -674,25 +674,22 @@ xfs_dir2_shrink_inode( ...@@ -674,25 +674,22 @@ xfs_dir2_shrink_inode(
mp = dp->i_mount; mp = dp->i_mount;
tp = args->trans; tp = args->trans;
da = xfs_dir2_db_to_da(args->geo, db); da = xfs_dir2_db_to_da(args->geo, db);
/* Unmap the fsblock(s). */
error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0,
args->firstblock, args->flist, &done);
if (error) {
/* /*
* Unmap the fsblock(s). * ENOSPC actually can happen if we're in a removename with no
*/ * space reservation, and the resulting block removal would
if ((error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, * cause a bmap btree split or conversion from extents to btree.
XFS_BMAPI_METADATA, 0, args->firstblock, args->flist, * This can only happen for un-fragmented directory blocks,
&done))) { * 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
* ENOSPC actually can happen if we're in a removename with * binval it. So the block has to be in a consistent empty
* no space reservation, and the resulting block removal * state and appropriately logged. We don't free up the buffer,
* would cause a bmap btree split or conversion from extents * the caller can tell it hasn't happened since it got an error
* to btree. This can only happen for un-fragmented * back.
* 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; return error;
} }
......
...@@ -501,7 +501,7 @@ xfs_inactive_symlink_rmt( ...@@ -501,7 +501,7 @@ xfs_inactive_symlink_rmt(
/* /*
* Unmap the dead block(s) to the free_list. * 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); &first_block, &free_list, &done);
if (error) if (error)
goto error_bmap_cancel; goto error_bmap_cancel;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册