Commit e16cf9b0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: pass a struct xfs_bmbt_irec to xfs_bmbt_lookup_eq

Now that we've massaged the callers into the right form we can always
pass the actual extent record instead of the individual fields.

As an additional benefit the btree cursor will now be prepoulated with
the correct extent state instead of having to fix it up later.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent a67d00a5
...@@ -112,14 +112,10 @@ xfs_bmap_compute_maxlevels( ...@@ -112,14 +112,10 @@ xfs_bmap_compute_maxlevels(
STATIC int /* error */ STATIC int /* error */
xfs_bmbt_lookup_eq( xfs_bmbt_lookup_eq(
struct xfs_btree_cur *cur, struct xfs_btree_cur *cur,
xfs_fileoff_t off, struct xfs_bmbt_irec *irec,
xfs_fsblock_t bno,
xfs_filblks_t len,
int *stat) /* success/failure */ int *stat) /* success/failure */
{ {
cur->bc_rec.b.br_startoff = off; cur->bc_rec.b = *irec;
cur->bc_rec.b.br_startblock = bno;
cur->bc_rec.b.br_blockcount = len;
return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
} }
...@@ -1697,9 +1693,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1697,9 +1693,7 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(bma->cur, RIGHT.br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
RIGHT.br_startblock,
RIGHT.br_blockcount, &i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -1735,9 +1729,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1735,9 +1729,7 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(bma->cur, old.br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -1763,9 +1755,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1763,9 +1755,7 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(bma->cur, RIGHT.br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
RIGHT.br_startblock,
RIGHT.br_blockcount, &i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -1792,13 +1782,10 @@ xfs_bmap_add_extent_delay_real( ...@@ -1792,13 +1782,10 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(bma->cur, new->br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
new->br_startblock, new->br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
bma->cur->bc_rec.b.br_state = XFS_EXT_NORM;
error = xfs_btree_insert(bma->cur, &i); error = xfs_btree_insert(bma->cur, &i);
if (error) if (error)
goto done; goto done;
...@@ -1832,9 +1819,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1832,9 +1819,7 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(bma->cur, old.br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -1857,13 +1842,10 @@ xfs_bmap_add_extent_delay_real( ...@@ -1857,13 +1842,10 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(bma->cur, new->br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
new->br_startblock, new->br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
bma->cur->bc_rec.b.br_state = XFS_EXT_NORM;
error = xfs_btree_insert(bma->cur, &i); error = xfs_btree_insert(bma->cur, &i);
if (error) if (error)
goto done; goto done;
...@@ -1910,9 +1892,7 @@ xfs_bmap_add_extent_delay_real( ...@@ -1910,9 +1892,7 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(bma->cur, old.br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
old.br_startblock,
old.br_blockcount, &i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -1945,13 +1925,10 @@ xfs_bmap_add_extent_delay_real( ...@@ -1945,13 +1925,10 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(bma->cur, new->br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
new->br_startblock, new->br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
bma->cur->bc_rec.b.br_state = XFS_EXT_NORM;
error = xfs_btree_insert(bma->cur, &i); error = xfs_btree_insert(bma->cur, &i);
if (error) if (error)
goto done; goto done;
...@@ -2033,13 +2010,10 @@ xfs_bmap_add_extent_delay_real( ...@@ -2033,13 +2010,10 @@ xfs_bmap_add_extent_delay_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(bma->cur, new->br_startoff, error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
new->br_startblock, new->br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
bma->cur->bc_rec.b.br_state = XFS_EXT_NORM;
error = xfs_btree_insert(bma->cur, &i); error = xfs_btree_insert(bma->cur, &i);
if (error) if (error)
goto done; goto done;
...@@ -2245,9 +2219,8 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2245,9 +2219,8 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff, error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
RIGHT.br_startblock, if (error)
RIGHT.br_blockcount, &i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
if ((error = xfs_btree_delete(cur, &i))) if ((error = xfs_btree_delete(cur, &i)))
...@@ -2287,9 +2260,8 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2287,9 +2260,8 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
if ((error = xfs_bmbt_lookup_eq(cur, PREV.br_startoff, error = xfs_bmbt_lookup_eq(cur, &PREV, &i);
PREV.br_startblock, PREV.br_blockcount, if (error)
&i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
if ((error = xfs_btree_delete(cur, &i))) if ((error = xfs_btree_delete(cur, &i)))
...@@ -2322,9 +2294,8 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2322,9 +2294,8 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
if ((error = xfs_bmbt_lookup_eq(cur, RIGHT.br_startoff, error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
RIGHT.br_startblock, if (error)
RIGHT.br_blockcount, &i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
if ((error = xfs_btree_delete(cur, &i))) if ((error = xfs_btree_delete(cur, &i)))
...@@ -2354,9 +2325,8 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2354,9 +2325,8 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff, error = xfs_bmbt_lookup_eq(cur, new, &i);
new->br_startblock, new->br_blockcount, if (error)
&i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
error = xfs_bmbt_update(cur, &PREV); error = xfs_bmbt_update(cur, &PREV);
...@@ -2389,9 +2359,7 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2389,9 +2359,7 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2427,9 +2395,7 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2427,9 +2395,7 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2467,9 +2433,7 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2467,9 +2433,7 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_DEXT; rval = XFS_ILOG_DEXT;
else { else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2505,21 +2469,17 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2505,21 +2469,17 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
error = xfs_bmbt_update(cur, &PREV); error = xfs_bmbt_update(cur, &PREV);
if (error) if (error)
goto done; goto done;
if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff, error = xfs_bmbt_lookup_eq(cur, new, &i);
new->br_startblock, new->br_blockcount, if (error)
&i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
cur->bc_rec.b.br_state = new->br_state;
if ((error = xfs_btree_insert(cur, &i))) if ((error = xfs_btree_insert(cur, &i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2554,9 +2514,7 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2554,9 +2514,7 @@ xfs_bmap_add_extent_unwritten_real(
rval = XFS_ILOG_CORE | XFS_ILOG_DEXT; rval = XFS_ILOG_CORE | XFS_ILOG_DEXT;
else { else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2574,13 +2532,11 @@ xfs_bmap_add_extent_unwritten_real( ...@@ -2574,13 +2532,11 @@ xfs_bmap_add_extent_unwritten_real(
* we are about to insert as we can't trust it after * we are about to insert as we can't trust it after
* the previous insert. * the previous insert.
*/ */
if ((error = xfs_bmbt_lookup_eq(cur, new->br_startoff, error = xfs_bmbt_lookup_eq(cur, new, &i);
new->br_startblock, new->br_blockcount, if (error)
&i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
/* new middle extent - newext */ /* new middle extent - newext */
cur->bc_rec.b.br_state = new->br_state;
if ((error = xfs_btree_insert(cur, &i))) if ((error = xfs_btree_insert(cur, &i)))
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2889,9 +2845,7 @@ xfs_bmap_add_extent_hole_real( ...@@ -2889,9 +2845,7 @@ xfs_bmap_add_extent_hole_real(
rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
} else { } else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(cur, right.br_startoff, error = xfs_bmbt_lookup_eq(cur, &right, &i);
right.br_startblock, right.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2926,9 +2880,7 @@ xfs_bmap_add_extent_hole_real( ...@@ -2926,9 +2880,7 @@ xfs_bmap_add_extent_hole_real(
rval = xfs_ilog_fext(whichfork); rval = xfs_ilog_fext(whichfork);
} else { } else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2956,9 +2908,7 @@ xfs_bmap_add_extent_hole_real( ...@@ -2956,9 +2908,7 @@ xfs_bmap_add_extent_hole_real(
rval = xfs_ilog_fext(whichfork); rval = xfs_ilog_fext(whichfork);
} else { } else {
rval = 0; rval = 0;
error = xfs_bmbt_lookup_eq(cur, old.br_startoff, error = xfs_bmbt_lookup_eq(cur, &old, &i);
old.br_startblock, old.br_blockcount,
&i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -2981,14 +2931,10 @@ xfs_bmap_add_extent_hole_real( ...@@ -2981,14 +2931,10 @@ xfs_bmap_add_extent_hole_real(
rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
} else { } else {
rval = XFS_ILOG_CORE; rval = XFS_ILOG_CORE;
error = xfs_bmbt_lookup_eq(cur, error = xfs_bmbt_lookup_eq(cur, new, &i);
new->br_startoff,
new->br_startblock,
new->br_blockcount, &i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, done);
cur->bc_rec.b.br_state = new->br_state;
error = xfs_btree_insert(cur, &i); error = xfs_btree_insert(cur, &i);
if (error) if (error)
goto done; goto done;
...@@ -5099,8 +5045,7 @@ xfs_bmap_del_extent_real( ...@@ -5099,8 +5045,7 @@ xfs_bmap_del_extent_real(
del_endblock = del->br_startblock + del->br_blockcount; del_endblock = del->br_startblock + del->br_blockcount;
if (cur) { if (cur) {
error = xfs_bmbt_lookup_eq(cur, got.br_startoff, error = xfs_bmbt_lookup_eq(cur, &got, &i);
got.br_startblock, got.br_blockcount, &i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -5203,9 +5148,7 @@ xfs_bmap_del_extent_real( ...@@ -5203,9 +5148,7 @@ xfs_bmap_del_extent_real(
* Reset the cursor, don't trust it after any * Reset the cursor, don't trust it after any
* insert operation. * insert operation.
*/ */
error = xfs_bmbt_lookup_eq(cur, got.br_startoff, error = xfs_bmbt_lookup_eq(cur, &got, &i);
got.br_startblock,
got.br_blockcount, &i);
if (error) if (error)
goto done; goto done;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, done);
...@@ -5733,8 +5676,7 @@ xfs_bmse_merge( ...@@ -5733,8 +5676,7 @@ xfs_bmse_merge(
} }
/* lookup and remove the extent to merge */ /* lookup and remove the extent to merge */
error = xfs_bmbt_lookup_eq(cur, got->br_startoff, got->br_startblock, error = xfs_bmbt_lookup_eq(cur, got, &i);
got->br_blockcount, &i);
if (error) if (error)
return error; return error;
XFS_WANT_CORRUPTED_RETURN(mp, i == 1); XFS_WANT_CORRUPTED_RETURN(mp, i == 1);
...@@ -5745,8 +5687,7 @@ xfs_bmse_merge( ...@@ -5745,8 +5687,7 @@ xfs_bmse_merge(
XFS_WANT_CORRUPTED_RETURN(mp, i == 1); XFS_WANT_CORRUPTED_RETURN(mp, i == 1);
/* lookup and update size of the previous extent */ /* lookup and update size of the previous extent */
error = xfs_bmbt_lookup_eq(cur, left->br_startoff, left->br_startblock, error = xfs_bmbt_lookup_eq(cur, left, &i);
left->br_blockcount, &i);
if (error) if (error)
return error; return error;
XFS_WANT_CORRUPTED_RETURN(mp, i == 1); XFS_WANT_CORRUPTED_RETURN(mp, i == 1);
...@@ -5862,8 +5803,7 @@ xfs_bmse_shift_one( ...@@ -5862,8 +5803,7 @@ xfs_bmse_shift_one(
new.br_startoff = startoff; new.br_startoff = startoff;
if (cur) { if (cur) {
error = xfs_bmbt_lookup_eq(cur, got->br_startoff, error = xfs_bmbt_lookup_eq(cur, got, &i);
got->br_startblock, got->br_blockcount, &i);
if (error) if (error)
return error; return error;
XFS_WANT_CORRUPTED_RETURN(mp, i == 1); XFS_WANT_CORRUPTED_RETURN(mp, i == 1);
...@@ -6115,10 +6055,7 @@ xfs_bmap_split_extent_at( ...@@ -6115,10 +6055,7 @@ xfs_bmap_split_extent_at(
cur->bc_private.b.firstblock = *firstfsb; cur->bc_private.b.firstblock = *firstfsb;
cur->bc_private.b.dfops = dfops; cur->bc_private.b.dfops = dfops;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
error = xfs_bmbt_lookup_eq(cur, got.br_startoff, error = xfs_bmbt_lookup_eq(cur, &got, &i);
got.br_startblock,
got.br_blockcount,
&i);
if (error) if (error)
goto del_cursor; goto del_cursor;
XFS_WANT_CORRUPTED_GOTO(mp, i == 1, del_cursor); XFS_WANT_CORRUPTED_GOTO(mp, i == 1, del_cursor);
...@@ -6142,14 +6079,10 @@ xfs_bmap_split_extent_at( ...@@ -6142,14 +6079,10 @@ xfs_bmap_split_extent_at(
XFS_IFORK_NEXTENTS(ip, whichfork) + 1); XFS_IFORK_NEXTENTS(ip, whichfork) + 1);
if (cur) { if (cur) {
error = xfs_bmbt_lookup_eq(cur, new.br_startoff, error = xfs_bmbt_lookup_eq(cur, &new, &i);
new.br_startblock, new.br_blockcount,
&i);
if (error) if (error)
goto del_cursor; goto del_cursor;
XFS_WANT_CORRUPTED_GOTO(mp, i == 0, del_cursor); XFS_WANT_CORRUPTED_GOTO(mp, i == 0, del_cursor);
cur->bc_rec.b.br_state = new.br_state;
error = xfs_btree_insert(cur, &i); error = xfs_btree_insert(cur, &i);
if (error) if (error)
goto del_cursor; goto del_cursor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment