aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYingping Lu <yingping@sgi.com>2005-11-01 23:10:24 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 23:10:24 -0500
commit91e11088f88e07f5f42c88608329bc0756c183f9 (patch)
treee6bc0635069edf81174b7e13f816f051ff02bd26
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>
-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(
423 int numrecs, 423 int numrecs,
424 int *count); 424 int *count);
425 425
426STATIC int
427xfs_bmap_disk_count_leaves(
428 xfs_bmbt_rec_t *frp,
429 int numrecs,
430 int *count);
431
426/* 432/*
427 * Bmap internal routines. 433 * Bmap internal routines.
428 */ 434 */
@@ -6282,7 +6288,7 @@ xfs_bmap_count_tree(
6282 numrecs = INT_GET(block->bb_numrecs, ARCH_CONVERT); 6288 numrecs = INT_GET(block->bb_numrecs, ARCH_CONVERT);
6283 frp = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize, 6289 frp = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize,
6284 xfs_bmbt, block, 1, mp->m_bmap_dmxr[0]); 6290 xfs_bmbt, block, 1, mp->m_bmap_dmxr[0]);
6285 if (unlikely(xfs_bmap_count_leaves(frp, numrecs, count) < 0)) { 6291 if (unlikely(xfs_bmap_disk_count_leaves(frp, numrecs, count) < 0)) {
6286 xfs_trans_brelse(tp, bp); 6292 xfs_trans_brelse(tp, bp);
6287 XFS_ERROR_REPORT("xfs_bmap_count_tree(2)", 6293 XFS_ERROR_REPORT("xfs_bmap_count_tree(2)",
6288 XFS_ERRLEVEL_LOW, mp); 6294 XFS_ERRLEVEL_LOW, mp);
@@ -6314,6 +6320,22 @@ xfs_bmap_count_leaves(
6314 int b; 6320 int b;
6315 6321
6316 for ( b = 1; b <= numrecs; b++, frp++) 6322 for ( b = 1; b <= numrecs; b++, frp++)
6323 *count += xfs_bmbt_get_blockcount(frp);
6324 return 0;
6325}
6326
6327/*
6328 * Count leaf blocks given a pointer to an extent list originally in btree format.
6329 */
6330int
6331xfs_bmap_disk_count_leaves(
6332 xfs_bmbt_rec_t *frp,
6333 int numrecs,
6334 int *count)
6335{
6336 int b;
6337
6338 for ( b = 1; b <= numrecs; b++, frp++)
6317 *count += xfs_bmbt_disk_get_blockcount(frp); 6339 *count += xfs_bmbt_disk_get_blockcount(frp);
6318 return 0; 6340 return 0;
6319} 6341}