xfs: revert "xfs: factor rmap btree size into the indlen calculations"
PATCH 1/1 xfs: revert "xfs: factor rmap btree size into the indlen calculations"
In commit fd26a88093ba we added a worst case estimate for rmapbt blocks needed to satisfy the block mapping request. Since then, we added the ability to reserve enough space in each AG such that we should never run out of blocks to grow the rmapbt, which makes this calculation unnecessary. Revert the commit because it makes the extra delalloc indlen accounting unnecessary and incorrect.
--- fs/xfs/libxfs/xfs_bmap.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
fs/xfs/libxfs/xfs_bmap.c +2 -15
@@ -49,7 +49,6 @@#include "xfs_rmap.h" #include "xfs_ag_resv.h" #include "xfs_refcount.h" -#include "xfs_rmap_btree.h" #include "xfs_icache.h"
@@ -192,12 +191,8 @@ xfs_bmap_worst_indlen(int maxrecs;/* maximum record count at this level */ xfs_mount_t *mp;/* mount structure */ xfs_filblks_t rval;/* return value */ -xfs_filblks_t orig_len; mp = ip->i_mount; - -/* Calculate the worst-case size of the bmbt. */ - orig_len = len; maxrecs = mp->m_bmap_dmxr[0 ]; for (level = 0, rval = 0; level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK);
@@ -205,20 +200,12 @@ xfs_bmap_worst_indlen( len += maxrecs -1 ;do_div (len, maxrecs); rval += len; -if (len ==1 ) { - rval +=XFS_BM_MAXLEVELS (mp,XFS_DATA_FORK ) - +if (len ==1 ) +return rval +XFS_BM_MAXLEVELS (mp,XFS_DATA_FORK ) - level -1 ; -break ; - }if (level ==0 ) maxrecs = mp->m_bmap_dmxr[1 ]; } - -/* Calculate the worst-case size of the rmapbt. */ -if (xfs_sb_version_hasrmapbt (&mp->m_sb)) - rval +=1 +xfs_rmapbt_calc_size (mp, orig_len) + - mp->m_rmap_maxlevels; -return rval; }
Quoted 10 lines · Darrick J. Wong
In commit
fd26a88093bawe added a worst case estimate for rmapbt blocks needed to satisfy the block mapping request. Since then, we added the ability to reserve enough space in each AG such that we should never run out of blocks to grow the rmapbt, which makes this calculation unnecessary. Revert the commit because it makes the extra delalloc indlen accounting unnecessary and incorrect.Reported-by Eryu Guan <[email protected]>Signed-off-by Darrick J. Wong <[email protected]>---
Quoted 55 lines
fs/xfs/libxfs/xfs_bmap.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)fs/xfs/libxfs/xfs_bmap.c +2
-16@@ -49,7 +49,6 @@#include "xfs_rmap.h" #include "xfs_ag_resv.h" #include "xfs_refcount.h" -#include "xfs_rmap_btree.h" #include "xfs_icache.h" @@ -192,12 +191,8 @@ xfs_bmap_worst_indlen(int maxrecs;/* maximum record count at this level */ xfs_mount_t *mp;/* mount structure */ xfs_filblks_t rval;/* return value */ -xfs_filblks_t orig_len; mp = ip->i_mount; - -/* Calculate the worst-case size of the bmbt. */ - orig_len = len; maxrecs = mp->m_bmap_dmxr[0 ]; for (level = 0, rval = 0; level < XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK);@@ -205,20 +200,12 @@ xfs_bmap_worst_indlen( len += maxrecs -1 ;do_div (len, maxrecs); rval += len; -if (len ==1 ) { - rval +=XFS_BM_MAXLEVELS (mp,XFS_DATA_FORK ) - +if (len ==1 ) +return rval +XFS_BM_MAXLEVELS (mp,XFS_DATA_FORK ) - level -1 ; -break ; - }if (level ==0 ) maxrecs = mp->m_bmap_dmxr[1 ]; } - -/* Calculate the worst-case size of the rmapbt. */ -if (xfs_sb_version_hasrmapbt (&mp->m_sb)) - rval +=1 +xfs_rmapbt_calc_size (mp, orig_len) + - mp->m_rmap_maxlevels; -return rval; } --To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Darrick J. Wong
In commit
fd26a88093bawe added a worst case estimate for rmapbt blocks needed to satisfy the block mapping request. Since then, we added the ability to reserve enough space in each AG such that we should never run out of blocks to grow the rmapbt, which makes this calculation unnecessary. Revert the commit because it makes the extra delalloc indlen accounting unnecessary and incorrect.
Looks good,