mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
xfs: get rid of XFS_IALLOC_BLOCKS macros
Get rid of XFS_IALLOC_BLOCKS() marcos, use mp->m_ialloc_blks directly. Signed-off-by: Jie Liu <jeff.liu@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
0f49efd805
commit
126cd105d4
6 changed files with 15 additions and 20 deletions
|
@ -333,7 +333,7 @@ xfs_ialloc_ag_alloc(
|
||||||
if (args.mp->m_maxicount &&
|
if (args.mp->m_maxicount &&
|
||||||
args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)
|
args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount)
|
||||||
return XFS_ERROR(ENOSPC);
|
return XFS_ERROR(ENOSPC);
|
||||||
args.minlen = args.maxlen = XFS_IALLOC_BLOCKS(args.mp);
|
args.minlen = args.maxlen = args.mp->m_ialloc_blks;
|
||||||
/*
|
/*
|
||||||
* First try to allocate inodes contiguous with the last-allocated
|
* First try to allocate inodes contiguous with the last-allocated
|
||||||
* chunk of inodes. If the filesystem is striped, this will fill
|
* chunk of inodes. If the filesystem is striped, this will fill
|
||||||
|
@ -343,7 +343,7 @@ xfs_ialloc_ag_alloc(
|
||||||
newino = be32_to_cpu(agi->agi_newino);
|
newino = be32_to_cpu(agi->agi_newino);
|
||||||
agno = be32_to_cpu(agi->agi_seqno);
|
agno = be32_to_cpu(agi->agi_seqno);
|
||||||
args.agbno = XFS_AGINO_TO_AGBNO(args.mp, newino) +
|
args.agbno = XFS_AGINO_TO_AGBNO(args.mp, newino) +
|
||||||
XFS_IALLOC_BLOCKS(args.mp);
|
args.mp->m_ialloc_blks;
|
||||||
if (likely(newino != NULLAGINO &&
|
if (likely(newino != NULLAGINO &&
|
||||||
(args.agbno < be32_to_cpu(agi->agi_length)))) {
|
(args.agbno < be32_to_cpu(agi->agi_length)))) {
|
||||||
args.fsbno = XFS_AGB_TO_FSB(args.mp, agno, args.agbno);
|
args.fsbno = XFS_AGB_TO_FSB(args.mp, agno, args.agbno);
|
||||||
|
@ -585,7 +585,7 @@ xfs_ialloc_ag_select(
|
||||||
* Is there enough free space for the file plus a block of
|
* Is there enough free space for the file plus a block of
|
||||||
* inodes? (if we need to allocate some)?
|
* inodes? (if we need to allocate some)?
|
||||||
*/
|
*/
|
||||||
ineed = XFS_IALLOC_BLOCKS(mp);
|
ineed = mp->m_ialloc_blks;
|
||||||
longest = pag->pagf_longest;
|
longest = pag->pagf_longest;
|
||||||
if (!longest)
|
if (!longest)
|
||||||
longest = pag->pagf_flcount > 0;
|
longest = pag->pagf_flcount > 0;
|
||||||
|
@ -1228,9 +1228,9 @@ xfs_difree(
|
||||||
goto error0;
|
goto error0;
|
||||||
}
|
}
|
||||||
|
|
||||||
xfs_bmap_add_free(XFS_AGB_TO_FSB(mp,
|
xfs_bmap_add_free(XFS_AGB_TO_FSB(mp, agno,
|
||||||
agno, XFS_AGINO_TO_AGBNO(mp, rec.ir_startino)),
|
XFS_AGINO_TO_AGBNO(mp, rec.ir_startino)),
|
||||||
XFS_IALLOC_BLOCKS(mp), flist, mp);
|
mp->m_ialloc_blks, flist, mp);
|
||||||
} else {
|
} else {
|
||||||
*delete = 0;
|
*delete = 0;
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,6 @@ struct xfs_mount;
|
||||||
struct xfs_trans;
|
struct xfs_trans;
|
||||||
struct xfs_btree_cur;
|
struct xfs_btree_cur;
|
||||||
|
|
||||||
/*
|
|
||||||
* Allocation parameters for inode allocation.
|
|
||||||
*/
|
|
||||||
#define XFS_IALLOC_BLOCKS(mp) (mp)->m_ialloc_blks
|
|
||||||
|
|
||||||
/* Move inodes in clusters of this size */
|
/* Move inodes in clusters of this size */
|
||||||
#define XFS_INODE_BIG_CLUSTER_SIZE 8192
|
#define XFS_INODE_BIG_CLUSTER_SIZE 8192
|
||||||
|
|
||||||
|
|
|
@ -2155,12 +2155,12 @@ xfs_ifree_cluster(
|
||||||
if (mp->m_sb.sb_blocksize >= mp->m_inode_cluster_size) {
|
if (mp->m_sb.sb_blocksize >= mp->m_inode_cluster_size) {
|
||||||
blks_per_cluster = 1;
|
blks_per_cluster = 1;
|
||||||
ninodes = mp->m_sb.sb_inopblock;
|
ninodes = mp->m_sb.sb_inopblock;
|
||||||
nbufs = XFS_IALLOC_BLOCKS(mp);
|
nbufs = mp->m_ialloc_blks;
|
||||||
} else {
|
} else {
|
||||||
blks_per_cluster = mp->m_inode_cluster_size /
|
blks_per_cluster = mp->m_inode_cluster_size /
|
||||||
mp->m_sb.sb_blocksize;
|
mp->m_sb.sb_blocksize;
|
||||||
ninodes = blks_per_cluster * mp->m_sb.sb_inopblock;
|
ninodes = blks_per_cluster * mp->m_sb.sb_inopblock;
|
||||||
nbufs = XFS_IALLOC_BLOCKS(mp) / blks_per_cluster;
|
nbufs = mp->m_ialloc_blks / blks_per_cluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < nbufs; j++, inum += ninodes) {
|
for (j = 0; j < nbufs; j++, inum += ninodes) {
|
||||||
|
|
|
@ -3209,9 +3209,9 @@ xlog_recover_do_icreate_pass2(
|
||||||
|
|
||||||
/* existing allocation is fixed value */
|
/* existing allocation is fixed value */
|
||||||
ASSERT(count == mp->m_ialloc_inos);
|
ASSERT(count == mp->m_ialloc_inos);
|
||||||
ASSERT(length == XFS_IALLOC_BLOCKS(mp));
|
ASSERT(length == mp->m_ialloc_blks);
|
||||||
if (count != mp->m_ialloc_inos ||
|
if (count != mp->m_ialloc_inos ||
|
||||||
length != XFS_IALLOC_BLOCKS(mp)) {
|
length != mp->m_ialloc_blks) {
|
||||||
xfs_warn(log->l_mp, "xlog_recover_do_icreate_trans: bad count 2");
|
xfs_warn(log->l_mp, "xlog_recover_do_icreate_trans: bad count 2");
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ xfs_calc_itruncate_reservation(
|
||||||
xfs_calc_buf_res(5, 0) +
|
xfs_calc_buf_res(5, 0) +
|
||||||
xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
|
xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
|
||||||
XFS_FSB_TO_B(mp, 1)) +
|
XFS_FSB_TO_B(mp, 1)) +
|
||||||
xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) +
|
xfs_calc_buf_res(2 + mp->m_ialloc_blks +
|
||||||
mp->m_in_maxlevels, 0)));
|
mp->m_in_maxlevels, 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ xfs_calc_create_resv_modify(
|
||||||
* For create we can allocate some inodes giving:
|
* For create we can allocate some inodes giving:
|
||||||
* the agi and agf of the ag getting the new inodes: 2 * sectorsize
|
* the agi and agf of the ag getting the new inodes: 2 * sectorsize
|
||||||
* the superblock for the nlink flag: sector size
|
* the superblock for the nlink flag: sector size
|
||||||
* the inode blocks allocated: XFS_IALLOC_BLOCKS * blocksize
|
* the inode blocks allocated: mp->m_ialloc_blks * blocksize
|
||||||
* the inode btree: max depth * blocksize
|
* the inode btree: max depth * blocksize
|
||||||
* the allocation btrees: 2 trees * (max depth - 1) * block size
|
* the allocation btrees: 2 trees * (max depth - 1) * block size
|
||||||
*/
|
*/
|
||||||
|
@ -292,7 +292,7 @@ xfs_calc_create_resv_alloc(
|
||||||
{
|
{
|
||||||
return xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
|
return xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
|
||||||
mp->m_sb.sb_sectsize +
|
mp->m_sb.sb_sectsize +
|
||||||
xfs_calc_buf_res(XFS_IALLOC_BLOCKS(mp), XFS_FSB_TO_B(mp, 1)) +
|
xfs_calc_buf_res(mp->m_ialloc_blks, XFS_FSB_TO_B(mp, 1)) +
|
||||||
xfs_calc_buf_res(mp->m_in_maxlevels, XFS_FSB_TO_B(mp, 1)) +
|
xfs_calc_buf_res(mp->m_in_maxlevels, XFS_FSB_TO_B(mp, 1)) +
|
||||||
xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
|
xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
|
||||||
XFS_FSB_TO_B(mp, 1));
|
XFS_FSB_TO_B(mp, 1));
|
||||||
|
@ -387,7 +387,7 @@ xfs_calc_ifree_reservation(
|
||||||
xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) +
|
xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) +
|
||||||
max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size) +
|
max_t(uint, XFS_FSB_TO_B(mp, 1), mp->m_inode_cluster_size) +
|
||||||
xfs_calc_buf_res(1, 0) +
|
xfs_calc_buf_res(1, 0) +
|
||||||
xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) +
|
xfs_calc_buf_res(2 + mp->m_ialloc_blks +
|
||||||
mp->m_in_maxlevels, 0) +
|
mp->m_in_maxlevels, 0) +
|
||||||
xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
|
xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
|
||||||
XFS_FSB_TO_B(mp, 1));
|
XFS_FSB_TO_B(mp, 1));
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#define XFS_DIRREMOVE_SPACE_RES(mp) \
|
#define XFS_DIRREMOVE_SPACE_RES(mp) \
|
||||||
XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
|
XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
|
||||||
#define XFS_IALLOC_SPACE_RES(mp) \
|
#define XFS_IALLOC_SPACE_RES(mp) \
|
||||||
(XFS_IALLOC_BLOCKS(mp) + (mp)->m_in_maxlevels - 1)
|
((mp)->m_ialloc_blks + (mp)->m_in_maxlevels - 1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Space reservation values for various transactions.
|
* Space reservation values for various transactions.
|
||||||
|
|
Loading…
Add table
Reference in a new issue