mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
[XFS] split up xfs_btree_init_cursor
xfs_btree_init_cursor contains close to little shared code for the different btrees and will get even more non-common code in the future. Split it up into one routine per btree type. Because xfs_btree_dup_cursor needs to call the init routine for a generic btree cursor add a new btree operation vector that contains a dup_cursor method that initializes a new cursor based on an existing one. The btree operations vector is based on an idea and code from Dave Chinner and will grow more entries later during this series. SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32176a 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:
parent
f2277f06e6
commit
561f7d1739
12 changed files with 196 additions and 158 deletions
|
@ -335,8 +335,7 @@ xfs_ialloc_ag_alloc(
|
|||
/*
|
||||
* Insert records describing the new inode chunk into the btree.
|
||||
*/
|
||||
cur = xfs_btree_init_cursor(args.mp, tp, agbp, agno,
|
||||
XFS_BTNUM_INO, (xfs_inode_t *)0, 0);
|
||||
cur = xfs_inobt_init_cursor(args.mp, tp, agbp, agno);
|
||||
for (thisino = newino;
|
||||
thisino < newino + newlen;
|
||||
thisino += XFS_INODES_PER_CHUNK) {
|
||||
|
@ -676,8 +675,7 @@ nextag:
|
|||
*/
|
||||
agno = tagno;
|
||||
*IO_agbp = NULL;
|
||||
cur = xfs_btree_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno),
|
||||
XFS_BTNUM_INO, (xfs_inode_t *)0, 0);
|
||||
cur = xfs_inobt_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno));
|
||||
/*
|
||||
* If pagino is 0 (this is the root inode allocation) use newino.
|
||||
* This must work because we've just allocated some.
|
||||
|
@ -1022,8 +1020,7 @@ xfs_difree(
|
|||
/*
|
||||
* Initialize the cursor.
|
||||
*/
|
||||
cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO,
|
||||
(xfs_inode_t *)0, 0);
|
||||
cur = xfs_inobt_init_cursor(mp, tp, agbp, agno);
|
||||
#ifdef DEBUG
|
||||
if (cur->bc_nlevels == 1) {
|
||||
int freecount = 0;
|
||||
|
@ -1259,8 +1256,7 @@ xfs_dilocate(
|
|||
#endif /* DEBUG */
|
||||
return error;
|
||||
}
|
||||
cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO,
|
||||
(xfs_inode_t *)0, 0);
|
||||
cur = xfs_inobt_init_cursor(mp, tp, agbp, agno);
|
||||
if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))) {
|
||||
#ifdef DEBUG
|
||||
xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue