Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 12217
b: refs/heads/master
c: 91e1108
h: refs/heads/master
i:
  12215: 99f0c65
v: v3
  • Loading branch information
Yingping Lu authored and Nathan Scott committed Nov 2, 2005
1 parent 55d655a commit 1c2261b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9af0a70c07a0e7575ebbdb42ca9fb29ffaaf77c9
refs/heads/master: 91e11088f88e07f5f42c88608329bc0756c183f9
24 changes: 23 additions & 1 deletion trunk/fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ xfs_bmap_count_leaves(
int numrecs,
int *count);

STATIC int
xfs_bmap_disk_count_leaves(
xfs_bmbt_rec_t *frp,
int numrecs,
int *count);

/*
* Bmap internal routines.
*/
Expand Down Expand Up @@ -6282,7 +6288,7 @@ xfs_bmap_count_tree(
numrecs = INT_GET(block->bb_numrecs, ARCH_CONVERT);
frp = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize,
xfs_bmbt, block, 1, mp->m_bmap_dmxr[0]);
if (unlikely(xfs_bmap_count_leaves(frp, numrecs, count) < 0)) {
if (unlikely(xfs_bmap_disk_count_leaves(frp, numrecs, count) < 0)) {
xfs_trans_brelse(tp, bp);
XFS_ERROR_REPORT("xfs_bmap_count_tree(2)",
XFS_ERRLEVEL_LOW, mp);
Expand Down Expand Up @@ -6313,6 +6319,22 @@ xfs_bmap_count_leaves(
{
int b;

for ( b = 1; b <= numrecs; b++, frp++)
*count += xfs_bmbt_get_blockcount(frp);
return 0;
}

/*
* Count leaf blocks given a pointer to an extent list originally in btree format.
*/
int
xfs_bmap_disk_count_leaves(
xfs_bmbt_rec_t *frp,
int numrecs,
int *count)
{
int b;

for ( b = 1; b <= numrecs; b++, frp++)
*count += xfs_bmbt_disk_get_blockcount(frp);
return 0;
Expand Down

0 comments on commit 1c2261b

Please sign in to comment.