diff options
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r-- | fs/xfs/xfs_itable.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index cf6754a3c5b3..35118032a5d6 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -359,7 +359,6 @@ xfs_bulkstat( | |||
359 | int ubused; /* bytes used by formatter */ | 359 | int ubused; /* bytes used by formatter */ |
360 | xfs_buf_t *bp; /* ptr to on-disk inode cluster buf */ | 360 | xfs_buf_t *bp; /* ptr to on-disk inode cluster buf */ |
361 | xfs_dinode_t *dip; /* ptr into bp for specific inode */ | 361 | xfs_dinode_t *dip; /* ptr into bp for specific inode */ |
362 | xfs_inode_t *ip; /* ptr to in-core inode struct */ | ||
363 | 362 | ||
364 | /* | 363 | /* |
365 | * Get the last inode value, see if there's nothing to do. | 364 | * Get the last inode value, see if there's nothing to do. |
@@ -416,8 +415,7 @@ xfs_bulkstat( | |||
416 | /* | 415 | /* |
417 | * Allocate and initialize a btree cursor for ialloc btree. | 416 | * Allocate and initialize a btree cursor for ialloc btree. |
418 | */ | 417 | */ |
419 | cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO, | 418 | cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); |
420 | (xfs_inode_t *)0, 0); | ||
421 | irbp = irbuf; | 419 | irbp = irbuf; |
422 | irbufend = irbuf + nirbuf; | 420 | irbufend = irbuf + nirbuf; |
423 | end_of_ag = 0; | 421 | end_of_ag = 0; |
@@ -472,7 +470,7 @@ xfs_bulkstat( | |||
472 | * In any case, increment to the next record. | 470 | * In any case, increment to the next record. |
473 | */ | 471 | */ |
474 | if (!error) | 472 | if (!error) |
475 | error = xfs_inobt_increment(cur, 0, &tmp); | 473 | error = xfs_btree_increment(cur, 0, &tmp); |
476 | } else { | 474 | } else { |
477 | /* | 475 | /* |
478 | * Start of ag. Lookup the first inode chunk. | 476 | * Start of ag. Lookup the first inode chunk. |
@@ -539,7 +537,7 @@ xfs_bulkstat( | |||
539 | * Set agino to after this chunk and bump the cursor. | 537 | * Set agino to after this chunk and bump the cursor. |
540 | */ | 538 | */ |
541 | agino = gino + XFS_INODES_PER_CHUNK; | 539 | agino = gino + XFS_INODES_PER_CHUNK; |
542 | error = xfs_inobt_increment(cur, 0, &tmp); | 540 | error = xfs_btree_increment(cur, 0, &tmp); |
543 | cond_resched(); | 541 | cond_resched(); |
544 | } | 542 | } |
545 | /* | 543 | /* |
@@ -586,6 +584,8 @@ xfs_bulkstat( | |||
586 | 584 | ||
587 | if (flags & (BULKSTAT_FG_QUICK | | 585 | if (flags & (BULKSTAT_FG_QUICK | |
588 | BULKSTAT_FG_INLINE)) { | 586 | BULKSTAT_FG_INLINE)) { |
587 | int offset; | ||
588 | |||
589 | ino = XFS_AGINO_TO_INO(mp, agno, | 589 | ino = XFS_AGINO_TO_INO(mp, agno, |
590 | agino); | 590 | agino); |
591 | bno = XFS_AGB_TO_DADDR(mp, agno, | 591 | bno = XFS_AGB_TO_DADDR(mp, agno, |
@@ -594,21 +594,15 @@ xfs_bulkstat( | |||
594 | /* | 594 | /* |
595 | * Get the inode cluster buffer | 595 | * Get the inode cluster buffer |
596 | */ | 596 | */ |
597 | ASSERT(xfs_inode_zone != NULL); | ||
598 | ip = kmem_zone_zalloc(xfs_inode_zone, | ||
599 | KM_SLEEP); | ||
600 | ip->i_ino = ino; | ||
601 | ip->i_mount = mp; | ||
602 | spin_lock_init(&ip->i_flags_lock); | ||
603 | if (bp) | 597 | if (bp) |
604 | xfs_buf_relse(bp); | 598 | xfs_buf_relse(bp); |
605 | error = xfs_itobp(mp, NULL, ip, | 599 | |
606 | &dip, &bp, bno, | 600 | error = xfs_inotobp(mp, NULL, ino, &dip, |
607 | XFS_IMAP_BULKSTAT, | 601 | &bp, &offset, |
608 | XFS_BUF_LOCK); | 602 | XFS_IMAP_BULKSTAT); |
603 | |||
609 | if (!error) | 604 | if (!error) |
610 | clustidx = ip->i_boffset / mp->m_sb.sb_inodesize; | 605 | clustidx = offset / mp->m_sb.sb_inodesize; |
611 | kmem_zone_free(xfs_inode_zone, ip); | ||
612 | if (XFS_TEST_ERROR(error != 0, | 606 | if (XFS_TEST_ERROR(error != 0, |
613 | mp, XFS_ERRTAG_BULKSTAT_READ_CHUNK, | 607 | mp, XFS_ERRTAG_BULKSTAT_READ_CHUNK, |
614 | XFS_RANDOM_BULKSTAT_READ_CHUNK)) { | 608 | XFS_RANDOM_BULKSTAT_READ_CHUNK)) { |
@@ -842,8 +836,7 @@ xfs_inumbers( | |||
842 | agino = 0; | 836 | agino = 0; |
843 | continue; | 837 | continue; |
844 | } | 838 | } |
845 | cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, | 839 | cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); |
846 | XFS_BTNUM_INO, (xfs_inode_t *)0, 0); | ||
847 | error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); | 840 | error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); |
848 | if (error) { | 841 | if (error) { |
849 | xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); | 842 | xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); |
@@ -887,7 +880,7 @@ xfs_inumbers( | |||
887 | bufidx = 0; | 880 | bufidx = 0; |
888 | } | 881 | } |
889 | if (left) { | 882 | if (left) { |
890 | error = xfs_inobt_increment(cur, 0, &tmp); | 883 | error = xfs_btree_increment(cur, 0, &tmp); |
891 | if (error) { | 884 | if (error) { |
892 | xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); | 885 | xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); |
893 | cur = NULL; | 886 | cur = NULL; |