xfs: refactor inode geometry setup routines

Migrate all of the inode geometry setup code from xfs_mount.c into a
single libxfs function that we can share with xfsprogs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
Darrick J. Wong 2019-06-05 11:19:35 -07:00
parent ef32595999
commit 494dba7b27
4 changed files with 101 additions and 144 deletions

View file

@ -23,16 +23,6 @@ struct xfs_icluster {
* sparse chunks */
};
/* Calculate and return the number of filesystem blocks per inode cluster */
static inline int
xfs_icluster_size_fsb(
struct xfs_mount *mp)
{
if (mp->m_sb.sb_blocksize >= M_IGEO(mp)->inode_cluster_size)
return 1;
return M_IGEO(mp)->inode_cluster_size >> mp->m_sb.sb_blocklog;
}
/*
* Make an inode pointer out of the buffer/offset.
*/
@ -95,13 +85,6 @@ xfs_imap(
struct xfs_imap *imap, /* location map structure */
uint flags); /* flags for inode btree lookup */
/*
* Compute and fill in value of m_ino_geo.inobt_maxlevels.
*/
void
xfs_ialloc_compute_maxlevels(
struct xfs_mount *mp); /* file system mount structure */
/*
* Log specified fields for the ag hdr (inode section)
*/
@ -168,5 +151,6 @@ int xfs_inobt_insert_rec(struct xfs_btree_cur *cur, uint16_t holemask,
int *stat);
int xfs_ialloc_cluster_alignment(struct xfs_mount *mp);
void xfs_ialloc_setup_geometry(struct xfs_mount *mp);
#endif /* __XFS_IALLOC_H__ */