mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 12:32:50 +00:00
xfs: refactor xfs_rtsummary_blockcount
Make xfs_rtsummary_blockcount take all the required information from the mount structure and return the number of summary levels from it as well. This cleans up many of the callers and prepares for making the rtsummary files per-rtgroup where they need to look at different value. This means we recalculate some values in some callers, but as all these calculations are outside the fast path and cheap, which seems like a price worth paying. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
committed by
Darrick J. Wong
parent
5a7566c8d6
commit
f8c5a8415f
@@ -20,6 +20,7 @@
|
||||
#include "xfs_error.h"
|
||||
#include "xfs_rtbitmap.h"
|
||||
#include "xfs_health.h"
|
||||
#include "xfs_sb.h"
|
||||
|
||||
/*
|
||||
* Realtime allocator bitmap functions shared with userspace.
|
||||
@@ -1166,16 +1167,20 @@ xfs_rtbitmap_blockcount(
|
||||
return xfs_rtbitmap_blockcount_len(mp, mp->m_sb.sb_rextents);
|
||||
}
|
||||
|
||||
/* Compute the number of rtsummary blocks needed to track the given rt space. */
|
||||
/*
|
||||
* Compute the geometry of the rtsummary file needed to track the given rt
|
||||
* space.
|
||||
*/
|
||||
xfs_filblks_t
|
||||
xfs_rtsummary_blockcount(
|
||||
struct xfs_mount *mp,
|
||||
unsigned int rsumlevels,
|
||||
xfs_extlen_t rbmblocks)
|
||||
unsigned int *rsumlevels)
|
||||
{
|
||||
unsigned long long rsumwords;
|
||||
|
||||
rsumwords = (unsigned long long)rsumlevels * rbmblocks;
|
||||
*rsumlevels = xfs_compute_rextslog(mp->m_sb.sb_rextents) + 1;
|
||||
|
||||
rsumwords = xfs_rtbitmap_blockcount(mp) * (*rsumlevels);
|
||||
return XFS_B_TO_FSB(mp, rsumwords << XFS_WORDLOG);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user