Commit 91e11088 authored by Yingping Lu's avatar Yingping Lu Committed by Nathan Scott

[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: default avatarYingping Lu <yingping@sgi.com>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 9af0a70c
...@@ -423,6 +423,12 @@ xfs_bmap_count_leaves( ...@@ -423,6 +423,12 @@ xfs_bmap_count_leaves(
int numrecs, int numrecs,
int *count); int *count);
STATIC int
xfs_bmap_disk_count_leaves(
xfs_bmbt_rec_t *frp,
int numrecs,
int *count);
/* /*
* Bmap internal routines. * Bmap internal routines.
*/ */
...@@ -6282,7 +6288,7 @@ xfs_bmap_count_tree( ...@@ -6282,7 +6288,7 @@ xfs_bmap_count_tree(
numrecs = INT_GET(block->bb_numrecs, ARCH_CONVERT); numrecs = INT_GET(block->bb_numrecs, ARCH_CONVERT);
frp = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize, frp = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize,
xfs_bmbt, block, 1, mp->m_bmap_dmxr[0]); 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_trans_brelse(tp, bp);
XFS_ERROR_REPORT("xfs_bmap_count_tree(2)", XFS_ERROR_REPORT("xfs_bmap_count_tree(2)",
XFS_ERRLEVEL_LOW, mp); XFS_ERRLEVEL_LOW, mp);
...@@ -6313,6 +6319,22 @@ xfs_bmap_count_leaves( ...@@ -6313,6 +6319,22 @@ xfs_bmap_count_leaves(
{ {
int b; 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++) for ( b = 1; b <= numrecs; b++, frp++)
*count += xfs_bmbt_disk_get_blockcount(frp); *count += xfs_bmbt_disk_get_blockcount(frp);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment