[XFS] stop using xfs_itobp in xfs_bulkstat
[safe/jmp/linux-2.6] / fs / xfs / xfs_itable.c
index 4f4c939..3511803 100644 (file)
@@ -359,7 +359,6 @@ xfs_bulkstat(
        int                     ubused; /* bytes used by formatter */
        xfs_buf_t               *bp;    /* ptr to on-disk inode cluster buf */
        xfs_dinode_t            *dip;   /* ptr into bp for specific inode */
-       xfs_inode_t             *ip;    /* ptr to in-core inode struct */
 
        /*
         * Get the last inode value, see if there's nothing to do.
@@ -416,8 +415,7 @@ xfs_bulkstat(
                /*
                 * Allocate and initialize a btree cursor for ialloc btree.
                 */
-               cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO,
-                                               (xfs_inode_t *)0, 0);
+               cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno);
                irbp = irbuf;
                irbufend = irbuf + nirbuf;
                end_of_ag = 0;
@@ -472,7 +470,7 @@ xfs_bulkstat(
                         * In any case, increment to the next record.
                         */
                        if (!error)
-                               error = xfs_inobt_increment(cur, 0, &tmp);
+                               error = xfs_btree_increment(cur, 0, &tmp);
                } else {
                        /*
                         * Start of ag.  Lookup the first inode chunk.
@@ -539,7 +537,7 @@ xfs_bulkstat(
                         * Set agino to after this chunk and bump the cursor.
                         */
                        agino = gino + XFS_INODES_PER_CHUNK;
-                       error = xfs_inobt_increment(cur, 0, &tmp);
+                       error = xfs_btree_increment(cur, 0, &tmp);
                        cond_resched();
                }
                /*
@@ -586,6 +584,8 @@ xfs_bulkstat(
 
                                        if (flags & (BULKSTAT_FG_QUICK |
                                                     BULKSTAT_FG_INLINE)) {
+                                               int offset;
+
                                                ino = XFS_AGINO_TO_INO(mp, agno,
                                                                       agino);
                                                bno = XFS_AGB_TO_DADDR(mp, agno,
@@ -596,19 +596,13 @@ xfs_bulkstat(
                                                 */
                                                if (bp)
                                                        xfs_buf_relse(bp);
-                                               ip = xfs_inode_alloc(mp, ino);
-                                               if (!ip) {
-                                                       bp = NULL;
-                                                       rval = ENOMEM;
-                                                       break;
-                                               }
-                                               error = xfs_itobp(mp, NULL, ip,
-                                                               &dip, &bp, bno,
-                                                               XFS_IMAP_BULKSTAT,
-                                                               XFS_BUF_LOCK);
+
+                                               error = xfs_inotobp(mp, NULL, ino, &dip,
+                                                                   &bp, &offset,
+                                                                   XFS_IMAP_BULKSTAT);
+
                                                if (!error)
-                                                       clustidx = ip->i_boffset / mp->m_sb.sb_inodesize;
-                                               xfs_idestroy(ip);
+                                                       clustidx = offset / mp->m_sb.sb_inodesize;
                                                if (XFS_TEST_ERROR(error != 0,
                                                                   mp, XFS_ERRTAG_BULKSTAT_READ_CHUNK,
                                                                   XFS_RANDOM_BULKSTAT_READ_CHUNK)) {
@@ -842,8 +836,7 @@ xfs_inumbers(
                                agino = 0;
                                continue;
                        }
-                       cur = xfs_btree_init_cursor(mp, NULL, agbp, agno,
-                               XFS_BTNUM_INO, (xfs_inode_t *)0, 0);
+                       cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno);
                        error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp);
                        if (error) {
                                xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
@@ -887,7 +880,7 @@ xfs_inumbers(
                        bufidx = 0;
                }
                if (left) {
-                       error = xfs_inobt_increment(cur, 0, &tmp);
+                       error = xfs_btree_increment(cur, 0, &tmp);
                        if (error) {
                                xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
                                cur = NULL;