summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorDarrick J. Wong2018-12-12 17:46:25 +0100
committerDarrick J. Wong2018-12-12 17:47:17 +0100
commit83dcdb4469e759f984db92616d7885fc14329841 (patch)
treee0bafc6d2181267d8794b398eadd9a8fa840d0fd /fs/xfs/xfs_mount.c
parentxfs: add a block to inode count converter (diff)
downloadkernel-qcow2-linux-83dcdb4469e759f984db92616d7885fc14329841.tar.gz
kernel-qcow2-linux-83dcdb4469e759f984db92616d7885fc14329841.tar.xz
kernel-qcow2-linux-83dcdb4469e759f984db92616d7885fc14329841.zip
xfs: precalculate inodes and blocks per inode cluster
Store the number of inodes and blocks per inode cluster in the mount data so that we don't have to keep recalculating them. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 02d15098dbee..56d374675fd5 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -798,6 +798,8 @@ xfs_mountfs(
if (mp->m_sb.sb_inoalignmt >= XFS_B_TO_FSBT(mp, new_size))
mp->m_inode_cluster_size = new_size;
}
+ mp->m_blocks_per_cluster = xfs_icluster_size_fsb(mp);
+ mp->m_inodes_per_cluster = XFS_FSB_TO_INO(mp, mp->m_blocks_per_cluster);
/*
* If enabled, sparse inode chunk alignment is expected to match the