[XFS] implement generic xfs_btree_increment
From: Dave Chinner <dgc@sgi.com> Because this is the first major generic btree routine this patch includes some infrastrucure, first a few routines to deal with a btree block that can be either in short or long form, second xfs_btree_read_buf_block, which is the new central routine to read a btree block given a cursor, and third the new xfs_btree_ptr_addr routine to calculate the address for a given btree pointer record. [hch: split out from bigger patch and minor adaptions] SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32190a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Bill O'Donnell <billodo@sgi.com> Signed-off-by: David Chinner <david@fromorbit.com>
This commit is contained in:

committed by
Lachlan McIlroy

parent
65f1eaeac0
commit
637aa50f46
@@ -695,7 +695,7 @@ nextag:
|
||||
goto error0;
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
freecount += rec.ir_freecount;
|
||||
if ((error = xfs_inobt_increment(cur, 0, &i)))
|
||||
if ((error = xfs_btree_increment(cur, 0, &i)))
|
||||
goto error0;
|
||||
} while (i == 1);
|
||||
|
||||
@@ -753,7 +753,7 @@ nextag:
|
||||
/*
|
||||
* Search right with cur, go forward 1 record.
|
||||
*/
|
||||
if ((error = xfs_inobt_increment(cur, 0, &i)))
|
||||
if ((error = xfs_btree_increment(cur, 0, &i)))
|
||||
goto error1;
|
||||
doneright = !i;
|
||||
if (!doneright) {
|
||||
@@ -835,7 +835,7 @@ nextag:
|
||||
* further right.
|
||||
*/
|
||||
else {
|
||||
if ((error = xfs_inobt_increment(cur, 0,
|
||||
if ((error = xfs_btree_increment(cur, 0,
|
||||
&i)))
|
||||
goto error1;
|
||||
doneright = !i;
|
||||
@@ -890,7 +890,7 @@ nextag:
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
if (rec.ir_freecount > 0)
|
||||
break;
|
||||
if ((error = xfs_inobt_increment(cur, 0, &i)))
|
||||
if ((error = xfs_btree_increment(cur, 0, &i)))
|
||||
goto error0;
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
}
|
||||
@@ -924,7 +924,7 @@ nextag:
|
||||
goto error0;
|
||||
XFS_WANT_CORRUPTED_GOTO(i == 1, error0);
|
||||
freecount += rec.ir_freecount;
|
||||
if ((error = xfs_inobt_increment(cur, 0, &i)))
|
||||
if ((error = xfs_btree_increment(cur, 0, &i)))
|
||||
goto error0;
|
||||
} while (i == 1);
|
||||
ASSERT(freecount == be32_to_cpu(agi->agi_freecount) ||
|
||||
@@ -1033,7 +1033,7 @@ xfs_difree(
|
||||
goto error0;
|
||||
if (i) {
|
||||
freecount += rec.ir_freecount;
|
||||
if ((error = xfs_inobt_increment(cur, 0, &i)))
|
||||
if ((error = xfs_btree_increment(cur, 0, &i)))
|
||||
goto error0;
|
||||
}
|
||||
} while (i == 1);
|
||||
@@ -1138,7 +1138,7 @@ xfs_difree(
|
||||
goto error0;
|
||||
if (i) {
|
||||
freecount += rec.ir_freecount;
|
||||
if ((error = xfs_inobt_increment(cur, 0, &i)))
|
||||
if ((error = xfs_btree_increment(cur, 0, &i)))
|
||||
goto error0;
|
||||
}
|
||||
} while (i == 1);
|
||||
|
Reference in New Issue
Block a user