diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_ialloc_btree.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c index 86c50208a143..7fbf8af0b159 100644 --- a/fs/xfs/libxfs/xfs_ialloc_btree.c +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c | |||
@@ -538,15 +538,18 @@ xfs_inobt_rec_check_count( | |||
538 | 538 | ||
539 | static xfs_extlen_t | 539 | static xfs_extlen_t |
540 | xfs_inobt_max_size( | 540 | xfs_inobt_max_size( |
541 | struct xfs_mount *mp) | 541 | struct xfs_mount *mp, |
542 | xfs_agnumber_t agno) | ||
542 | { | 543 | { |
544 | xfs_agblock_t agblocks = xfs_ag_block_count(mp, agno); | ||
545 | |||
543 | /* Bail out if we're uninitialized, which can happen in mkfs. */ | 546 | /* Bail out if we're uninitialized, which can happen in mkfs. */ |
544 | if (mp->m_inobt_mxr[0] == 0) | 547 | if (mp->m_inobt_mxr[0] == 0) |
545 | return 0; | 548 | return 0; |
546 | 549 | ||
547 | return xfs_btree_calc_size(mp->m_inobt_mnr, | 550 | return xfs_btree_calc_size(mp->m_inobt_mnr, |
548 | (uint64_t)mp->m_sb.sb_agblocks * mp->m_sb.sb_inopblock / | 551 | (uint64_t)agblocks * mp->m_sb.sb_inopblock / |
549 | XFS_INODES_PER_CHUNK); | 552 | XFS_INODES_PER_CHUNK); |
550 | } | 553 | } |
551 | 554 | ||
552 | static int | 555 | static int |
@@ -594,7 +597,7 @@ xfs_finobt_calc_reserves( | |||
594 | if (error) | 597 | if (error) |
595 | return error; | 598 | return error; |
596 | 599 | ||
597 | *ask += xfs_inobt_max_size(mp); | 600 | *ask += xfs_inobt_max_size(mp, agno); |
598 | *used += tree_len; | 601 | *used += tree_len; |
599 | return 0; | 602 | return 0; |
600 | } | 603 | } |