summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorYingping Lu <yingping@sgi.com>2005-11-02 15:10:24 +1100
committerNathan Scott <nathans@sgi.com>2005-11-02 15:10:24 +1100
commit91e11088f88e07f5f42c88608329bc0756c183f9 (patch)
treee6bc0635069edf81174b7e13f816f051ff02bd26 /fs/xfs/xfs_bmap.c
parent9af0a70c07a0e7575ebbdb42ca9fb29ffaaf77c9 (diff)
[XFS] Fixing size report discrepancy between ls and du caused by xfs_fsr
SGI-PV: 943908 SGI-Modid: xfs-linux:xfs-kern:200874a Signed-off-by: Yingping Lu <yingping@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index e52387b3abef..9f635f0ccf08 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -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.
*/
@@ -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);
@@ -6314,6 +6320,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;
}