@@ -213,7 +213,10 @@ xfs_inobt_insert(
213213 int i ;
214214 int error ;
215215
216- cur = xfs_inobt_init_cursor (pag , tp , agbp , btnum );
216+ if (btnum == XFS_BTNUM_FINO )
217+ cur = xfs_finobt_init_cursor (pag , tp , agbp );
218+ else
219+ cur = xfs_inobt_init_cursor (pag , tp , agbp );
217220
218221 for (thisino = newino ;
219222 thisino < newino + newlen ;
@@ -554,7 +557,7 @@ xfs_inobt_insert_sprec(
554557 int i ;
555558 struct xfs_inobt_rec_incore rec ;
556559
557- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_INO );
560+ cur = xfs_inobt_init_cursor (pag , tp , agbp );
558561
559562 /* the new record is pre-aligned so we know where to look */
560563 error = xfs_inobt_lookup (cur , nrec -> ir_startino , XFS_LOOKUP_EQ , & i );
@@ -650,7 +653,7 @@ xfs_finobt_insert_sprec(
650653 int error ;
651654 int i ;
652655
653- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_FINO );
656+ cur = xfs_finobt_init_cursor (pag , tp , agbp );
654657
655658 /* the new record is pre-aligned so we know where to look */
656659 error = xfs_inobt_lookup (cur , nrec -> ir_startino , XFS_LOOKUP_EQ , & i );
@@ -1083,7 +1086,7 @@ xfs_dialloc_ag_inobt(
10831086 ASSERT (pag -> pagi_freecount > 0 );
10841087
10851088 restart_pagno :
1086- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_INO );
1089+ cur = xfs_inobt_init_cursor (pag , tp , agbp );
10871090 /*
10881091 * If pagino is 0 (this is the root inode allocation) use newino.
10891092 * This must work because we've just allocated some.
@@ -1557,7 +1560,7 @@ xfs_dialloc_ag(
15571560 if (!pagino )
15581561 pagino = be32_to_cpu (agi -> agi_newino );
15591562
1560- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_FINO );
1563+ cur = xfs_finobt_init_cursor (pag , tp , agbp );
15611564
15621565 error = xfs_check_agi_freecount (cur );
15631566 if (error )
@@ -1600,7 +1603,7 @@ xfs_dialloc_ag(
16001603 * the original freecount. If all is well, make the equivalent update to
16011604 * the inobt using the finobt record and offset information.
16021605 */
1603- icur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_INO );
1606+ icur = xfs_inobt_init_cursor (pag , tp , agbp );
16041607
16051608 error = xfs_check_agi_freecount (icur );
16061609 if (error )
@@ -2017,7 +2020,7 @@ xfs_difree_inobt(
20172020 /*
20182021 * Initialize the cursor.
20192022 */
2020- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_INO );
2023+ cur = xfs_inobt_init_cursor (pag , tp , agbp );
20212024
20222025 error = xfs_check_agi_freecount (cur );
20232026 if (error )
@@ -2144,7 +2147,7 @@ xfs_difree_finobt(
21442147 int error ;
21452148 int i ;
21462149
2147- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_FINO );
2150+ cur = xfs_finobt_init_cursor (pag , tp , agbp );
21482151
21492152 error = xfs_inobt_lookup (cur , ibtrec -> ir_startino , XFS_LOOKUP_EQ , & i );
21502153 if (error )
@@ -2344,7 +2347,7 @@ xfs_imap_lookup(
23442347 * we have a record, we need to ensure it contains the inode number
23452348 * we are looking up.
23462349 */
2347- cur = xfs_inobt_init_cursor (pag , tp , agbp , XFS_BTNUM_INO );
2350+ cur = xfs_inobt_init_cursor (pag , tp , agbp );
23482351 error = xfs_inobt_lookup (cur , agino , XFS_LOOKUP_LE , & i );
23492352 if (!error ) {
23502353 if (i )
@@ -3063,7 +3066,7 @@ xfs_ialloc_check_shrink(
30633066 if (!xfs_has_sparseinodes (pag -> pag_mount ))
30643067 return 0 ;
30653068
3066- cur = xfs_inobt_init_cursor (pag , tp , agibp , XFS_BTNUM_INO );
3069+ cur = xfs_inobt_init_cursor (pag , tp , agibp );
30673070
30683071 /* Look up the inobt record that would correspond to the new EOFS. */
30693072 agino = XFS_AGB_TO_AGINO (pag -> pag_mount , new_length );
0 commit comments