diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-09 20:02:01 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-16 03:57:05 +0300 |
commit | 14861c47400b4a1669956d8b027fe4b7855e39f1 (patch) | |
tree | 43c5f049a512128ed99e054fb94e10fea0b37e1c /fs/xfs/libxfs/xfs_bmap_btree.c | |
parent | 9d9c90286a74decf11caa9dd625f862ae0257ce0 (diff) | |
download | linux-14861c47400b4a1669956d8b027fe4b7855e39f1.tar.xz |
xfs: add helpers to calculate btree size
Add a bunch of helper functions that calculate the sizes of various
btrees. These will be used to repair btrees and btree headers.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap_btree.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index d89d06bea6e3..ac9d4aeedb09 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -660,3 +660,12 @@ xfs_bmbt_change_owner( xfs_btree_del_cursor(cur, error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR); return error; } + +/* Calculate the bmap btree size for some records. */ +unsigned long long +xfs_bmbt_calc_size( + struct xfs_mount *mp, + unsigned long long len) +{ + return xfs_btree_calc_size(mp->m_bmap_dmnr, len); +} |