xfs: use xfs_ialloc_blks_per_cluster in xfs_ifree_cluster
PATCH 4/5 xfs: use xfs_ialloc_blks_per_cluster in xfs_ifree_cluster
From: Jie Liu <[email protected]>
Use xfs_ialloc_blks_per_cluster() in xfs_ifree_cluster()
--- fs/xfs/xfs_inode.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
fs/xfs/xfs_inode.c +3 -10
@@ -2152,16 +2152,9 @@ xfs_ifree_cluster(struct xfs_perag *pag; pag =xfs_perag_get (mp,XFS_INO_TO_AGNO (mp, inum)); -if (mp->m_sb.sb_blocksize >=XFS_INODE_CLUSTER_SIZE (mp)) { - blks_per_cluster =1 ; - ninodes = mp->m_sb.sb_inopblock; - nbufs =XFS_IALLOC_BLOCKS (mp); - }else { - blks_per_cluster =XFS_INODE_CLUSTER_SIZE (mp) / - mp->m_sb.sb_blocksize; - ninodes = blks_per_cluster * mp->m_sb.sb_inopblock; - nbufs =XFS_IALLOC_BLOCKS (mp) / blks_per_cluster; - } + blks_per_cluster =xfs_ialloc_blks_per_cluster (mp); + ninodes = blks_per_cluster << mp->m_sb.sb_inopblog; + nbufs =XFS_IALLOC_BLOCKS (mp) / blks_per_cluster;for (j =0 ; j < nbufs; j++, inum += ninodes) { blkno = XFS_AGB_TO_DADDR(mp, XFS_INO_TO_AGNO(mp, inum),
Signature · 6 lines
1.8.3.2 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 20 lines · Jeff Liu
From: Jie Liu <[email protected]>
Use
xfs_ialloc_blks_per_cluster()inxfs_ifree_cluster()Signed-off-by Jie Liu <[email protected]>--- fs/xfs/xfs_inode.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)fs/xfs/xfs_inode.c +0
-3@@ -2152,16 +2152,9 @@ xfs_ifree_cluster(struct xfs_perag *pag; pag =xfs_perag_get (mp,XFS_INO_TO_AGNO (mp, inum)); -if (mp->m_sb.sb_blocksize >=XFS_INODE_CLUSTER_SIZE (mp)) { - blks_per_cluster =1 ; - ninodes = mp->m_sb.sb_inopblock;
fs/xfs/xfs_inode.c xfs_ifree_cluster( · line 2157
Quoted 10 lines
fs/xfs/xfs_inode.c +3
-7- nbufs =XFS_IALLOC_BLOCKS (mp); - }else { - blks_per_cluster =XFS_INODE_CLUSTER_SIZE (mp) / - mp->m_sb.sb_blocksize; - ninodes = blks_per_cluster * mp->m_sb.sb_inopblock; - nbufs =XFS_IALLOC_BLOCKS (mp) / blks_per_cluster; - } + blks_per_cluster =xfs_ialloc_blks_per_cluster (mp); + ninodes = blks_per_cluster << mp->m_sb.sb_inopblog; + nbufs =XFS_IALLOC_BLOCKS (mp) / blks_per_cluster;
I'd get rid of the XFS_IALLOC_BLOCKS() macros there and just use mp->m_ialloc_blks directly. Otherwise looks good.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 26 lines · Dave Chinner
Quoted 25 lines · Jeff Liu
From: Jie Liu <[email protected]>
Use
xfs_ialloc_blks_per_cluster()inxfs_ifree_cluster()Signed-off-by Jie Liu <[email protected]>--- fs/xfs/xfs_inode.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)fs/xfs/xfs_inode.c +0
-8@@ -2152,16 +2152,9 @@ xfs_ifree_cluster(struct xfs_perag *pag; pag =xfs_perag_get (mp,XFS_INO_TO_AGNO (mp, inum)); -if (mp->m_sb.sb_blocksize >=XFS_INODE_CLUSTER_SIZE (mp)) { - blks_per_cluster =1 ; - ninodes = mp->m_sb.sb_inopblock; - nbufs =XFS_IALLOC_BLOCKS (mp); - }else { - blks_per_cluster =XFS_INODE_CLUSTER_SIZE (mp) / - mp->m_sb.sb_blocksize; - ninodes = blks_per_cluster * mp->m_sb.sb_inopblock;
Quoted 8 lines
fs/xfs/xfs_inode.c xfs_ifree_cluster( · line 2157
Quoted 5 lines
fs/xfs/xfs_inode.c +3
-2- nbufs =XFS_IALLOC_BLOCKS (mp) / blks_per_cluster; - } + blks_per_cluster =xfs_ialloc_blks_per_cluster (mp); + ninodes = blks_per_cluster << mp->m_sb.sb_inopblog; + nbufs =XFS_IALLOC_BLOCKS (mp) / blks_per_cluster;I'd get rid of the
XFS_IALLOC_BLOCKS()macros there and just usemp->m_ialloc_blksdirectly. Otherwise looks good.
Agree, for the same reason as XFS_INODE_CLUSTER_SIZE() macros, I will kill it. Oh, it looks we can get rid of XFS_IALLOC_INODES() marcos as well...
Thanks,
-Jeff
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs