提交 491f6f8a 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: use the state defines in xfs_bmap_del_extent_real

Use the same defines as the other extent add and delete helpers, which
both improves code readability and trace point output.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 0173c689
...@@ -5160,13 +5160,13 @@ xfs_bmap_del_extent_real( ...@@ -5160,13 +5160,13 @@ xfs_bmap_del_extent_real(
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
} }
/* if (got.br_startoff == del->br_startoff)
* Set flag value to use in switch statement. state |= BMAP_LEFT_FILLING;
* Left-contig is 2, right-contig is 1. if (got_endoff == del_endoff)
*/ state |= BMAP_RIGHT_FILLING;
switch (((got.br_startoff == del->br_startoff) << 1) |
(got_endoff == del_endoff)) { switch (state & (BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING)) {
case 3: case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING:
/* /*
* Matches the whole extent. Delete the entry. * Matches the whole extent. Delete the entry.
*/ */
...@@ -5186,8 +5186,7 @@ xfs_bmap_del_extent_real( ...@@ -5186,8 +5186,7 @@ xfs_bmap_del_extent_real(
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
break; break;
case BMAP_LEFT_FILLING:
case 2:
/* /*
* Deleting the first part of the extent. * Deleting the first part of the extent.
*/ */
...@@ -5206,8 +5205,7 @@ xfs_bmap_del_extent_real( ...@@ -5206,8 +5205,7 @@ xfs_bmap_del_extent_real(
got.br_state))) got.br_state)))
goto done; goto done;
break; break;
case BMAP_RIGHT_FILLING:
case 1:
/* /*
* Deleting the last part of the extent. * Deleting the last part of the extent.
*/ */
...@@ -5225,7 +5223,6 @@ xfs_bmap_del_extent_real( ...@@ -5225,7 +5223,6 @@ xfs_bmap_del_extent_real(
got.br_state))) got.br_state)))
goto done; goto done;
break; break;
case 0: case 0:
/* /*
* Deleting the middle of the extent. * Deleting the middle of the extent.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册