aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c43
1 files changed, 5 insertions, 38 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 29c2f83d4147..b2bd3a0e6376 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -440,7 +440,7 @@ xfs_initialize_perag(
440 xfs_agnumber_t agcount, 440 xfs_agnumber_t agcount,
441 xfs_agnumber_t *maxagi) 441 xfs_agnumber_t *maxagi)
442{ 442{
443 xfs_agnumber_t index, max_metadata; 443 xfs_agnumber_t index;
444 xfs_agnumber_t first_initialised = 0; 444 xfs_agnumber_t first_initialised = 0;
445 xfs_perag_t *pag; 445 xfs_perag_t *pag;
446 xfs_agino_t agino; 446 xfs_agino_t agino;
@@ -500,43 +500,10 @@ xfs_initialize_perag(
500 else 500 else
501 mp->m_flags &= ~XFS_MOUNT_32BITINODES; 501 mp->m_flags &= ~XFS_MOUNT_32BITINODES;
502 502
503 if (mp->m_flags & XFS_MOUNT_32BITINODES) { 503 if (mp->m_flags & XFS_MOUNT_32BITINODES)
504 /* 504 index = xfs_set_inode32(mp);
505 * Calculate how much should be reserved for inodes to meet 505 else
506 * the max inode percentage. 506 index = xfs_set_inode64(mp);
507 */
508 if (mp->m_maxicount) {
509 __uint64_t icount;
510
511 icount = sbp->sb_dblocks * sbp->sb_imax_pct;
512 do_div(icount, 100);
513 icount += sbp->sb_agblocks - 1;
514 do_div(icount, sbp->sb_agblocks);
515 max_metadata = icount;
516 } else {
517 max_metadata = agcount;
518 }
519
520 for (index = 0; index < agcount; index++) {
521 ino = XFS_AGINO_TO_INO(mp, index, agino);
522 if (ino > XFS_MAXINUMBER_32) {
523 index++;
524 break;
525 }
526
527 pag = xfs_perag_get(mp, index);
528 pag->pagi_inodeok = 1;
529 if (index < max_metadata)
530 pag->pagf_metadata = 1;
531 xfs_perag_put(pag);
532 }
533 } else {
534 for (index = 0; index < agcount; index++) {
535 pag = xfs_perag_get(mp, index);
536 pag->pagi_inodeok = 1;
537 xfs_perag_put(pag);
538 }
539 }
540 507
541 if (maxagi) 508 if (maxagi)
542 *maxagi = index; 509 *maxagi = index;