Commit 4b4d98cc authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: finish converting to inodes_per_cluster

Finish converting all the old inode_cluster_size >> inopblog users to
inodes_per_cluster.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 490d451f
...@@ -33,12 +33,9 @@ xfs_inobp_check( ...@@ -33,12 +33,9 @@ xfs_inobp_check(
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
int i; int i;
int j;
xfs_dinode_t *dip; xfs_dinode_t *dip;
j = M_IGEO(mp)->inode_cluster_size >> mp->m_sb.sb_inodelog; for (i = 0; i < M_IGEO(mp)->inodes_per_cluster; i++) {
for (i = 0; i < j; i++) {
dip = xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize); dip = xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize);
if (!dip->di_next_unlinked) { if (!dip->di_next_unlinked) {
xfs_alert(mp, xfs_alert(mp,
......
...@@ -3473,7 +3473,6 @@ xfs_iflush_cluster( ...@@ -3473,7 +3473,6 @@ xfs_iflush_cluster(
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
struct xfs_perag *pag; struct xfs_perag *pag;
unsigned long first_index, mask; unsigned long first_index, mask;
unsigned long inodes_per_cluster;
int cilist_size; int cilist_size;
struct xfs_inode **cilist; struct xfs_inode **cilist;
struct xfs_inode *cip; struct xfs_inode *cip;
...@@ -3484,18 +3483,17 @@ xfs_iflush_cluster( ...@@ -3484,18 +3483,17 @@ xfs_iflush_cluster(
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
inodes_per_cluster = igeo->inode_cluster_size >> mp->m_sb.sb_inodelog; cilist_size = igeo->inodes_per_cluster * sizeof(struct xfs_inode *);
cilist_size = inodes_per_cluster * sizeof(xfs_inode_t *);
cilist = kmem_alloc(cilist_size, KM_MAYFAIL|KM_NOFS); cilist = kmem_alloc(cilist_size, KM_MAYFAIL|KM_NOFS);
if (!cilist) if (!cilist)
goto out_put; goto out_put;
mask = ~(((igeo->inode_cluster_size >> mp->m_sb.sb_inodelog)) - 1); mask = ~(igeo->inodes_per_cluster - 1);
first_index = XFS_INO_TO_AGINO(mp, ip->i_ino) & mask; first_index = XFS_INO_TO_AGINO(mp, ip->i_ino) & mask;
rcu_read_lock(); rcu_read_lock();
/* really need a gang lookup range call here */ /* really need a gang lookup range call here */
nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)cilist, nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)cilist,
first_index, inodes_per_cluster); first_index, igeo->inodes_per_cluster);
if (nr_found == 0) if (nr_found == 0)
goto out_free; goto out_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment