aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_itable.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-08-31 19:58:21 -0400
committerFelix Blyakher <felixb@sgi.com>2009-09-01 13:45:39 -0400
commit2187550525d7bcb8c87689e4eca41b1955bf9ac3 (patch)
tree1538be459d9d37a9daf537885e93a3cf20ee49c8 /fs/xfs/xfs_itable.c
parent4254b0bbb1c0826b7443ffa593576696bc591aa2 (diff)
xfs: rationalize xfs_inobt_lookup*
Currenly we have a xfs_inobt_lookup* variant for each comparism direction, and all these get all three fields of the inobt records passed, while the common case is just looking for the inode number and we have only marginally more callers than xfs_inobt_lookup* variants. So opencode a direct call to xfs_btree_lookup for the single case where we need all fields, and replace xfs_inobt_lookup* with a xfs_inobt_looku that just takes the inode number and the direction for all other callers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Signed-off-by: Felix Blyakher <felixb@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_itable.c')
-rw-r--r--fs/xfs/xfs_itable.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
index 3ec13e8a8c54..b68f9107e26c 100644
--- a/fs/xfs/xfs_itable.c
+++ b/fs/xfs/xfs_itable.c
@@ -444,7 +444,8 @@ xfs_bulkstat(
444 /* 444 /*
445 * Lookup the inode chunk that this inode lives in. 445 * Lookup the inode chunk that this inode lives in.
446 */ 446 */
447 error = xfs_inobt_lookup_le(cur, agino, 0, 0, &tmp); 447 error = xfs_inobt_lookup(cur, agino, XFS_LOOKUP_LE,
448 &tmp);
448 if (!error && /* no I/O error */ 449 if (!error && /* no I/O error */
449 tmp && /* lookup succeeded */ 450 tmp && /* lookup succeeded */
450 /* got the record, should always work */ 451 /* got the record, should always work */
@@ -492,7 +493,7 @@ xfs_bulkstat(
492 /* 493 /*
493 * Start of ag. Lookup the first inode chunk. 494 * Start of ag. Lookup the first inode chunk.
494 */ 495 */
495 error = xfs_inobt_lookup_ge(cur, 0, 0, 0, &tmp); 496 error = xfs_inobt_lookup(cur, 0, XFS_LOOKUP_GE, &tmp);
496 icount = 0; 497 icount = 0;
497 } 498 }
498 /* 499 /*
@@ -511,8 +512,8 @@ xfs_bulkstat(
511 if (XFS_AGINO_TO_AGBNO(mp, agino) >= 512 if (XFS_AGINO_TO_AGBNO(mp, agino) >=
512 be32_to_cpu(agi->agi_length)) 513 be32_to_cpu(agi->agi_length))
513 break; 514 break;
514 error = xfs_inobt_lookup_ge(cur, agino, 0, 0, 515 error = xfs_inobt_lookup(cur, agino,
515 &tmp); 516 XFS_LOOKUP_GE, &tmp);
516 cond_resched(); 517 cond_resched();
517 } 518 }
518 /* 519 /*
@@ -858,7 +859,8 @@ xfs_inumbers(
858 continue; 859 continue;
859 } 860 }
860 cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); 861 cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno);
861 error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); 862 error = xfs_inobt_lookup(cur, agino, XFS_LOOKUP_GE,
863 &tmp);
862 if (error) { 864 if (error) {
863 xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); 865 xfs_btree_del_cursor(cur, XFS_BTREE_ERROR);
864 cur = NULL; 866 cur = NULL;