aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 986c5577c4e9..b194652033cd 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -205,9 +205,6 @@ xfs_parseargs(
205 */ 205 */
206 mp->m_flags |= XFS_MOUNT_BARRIER; 206 mp->m_flags |= XFS_MOUNT_BARRIER;
207 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; 207 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
208#if !XFS_BIG_INUMS
209 mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
210#endif
211 208
212 /* 209 /*
213 * These can be overridden by the mount option parsing. 210 * These can be overridden by the mount option parsing.
@@ -314,11 +311,6 @@ xfs_parseargs(
314 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; 311 mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
315 } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { 312 } else if (!strcmp(this_char, MNTOPT_64BITINODE)) {
316 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; 313 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS;
317#if !XFS_BIG_INUMS
318 xfs_warn(mp, "%s option not allowed on this system",
319 this_char);
320 return -EINVAL;
321#endif
322 } else if (!strcmp(this_char, MNTOPT_NOUUID)) { 314 } else if (!strcmp(this_char, MNTOPT_NOUUID)) {
323 mp->m_flags |= XFS_MOUNT_NOUUID; 315 mp->m_flags |= XFS_MOUNT_NOUUID;
324 } else if (!strcmp(this_char, MNTOPT_BARRIER)) { 316 } else if (!strcmp(this_char, MNTOPT_BARRIER)) {
@@ -598,15 +590,20 @@ xfs_max_file_offset(
598 return (((__uint64_t)pagefactor) << bitshift) - 1; 590 return (((__uint64_t)pagefactor) << bitshift) - 1;
599} 591}
600 592
593/*
594 * xfs_set_inode32() and xfs_set_inode64() are passed an agcount
595 * because in the growfs case, mp->m_sb.sb_agcount is not updated
596 * yet to the potentially higher ag count.
597 */
601xfs_agnumber_t 598xfs_agnumber_t
602xfs_set_inode32(struct xfs_mount *mp) 599xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount)
603{ 600{
604 xfs_agnumber_t index = 0; 601 xfs_agnumber_t index = 0;
605 xfs_agnumber_t maxagi = 0; 602 xfs_agnumber_t maxagi = 0;
606 xfs_sb_t *sbp = &mp->m_sb; 603 xfs_sb_t *sbp = &mp->m_sb;
607 xfs_agnumber_t max_metadata; 604 xfs_agnumber_t max_metadata;
608 xfs_agino_t agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks -1, 0); 605 xfs_agino_t agino;
609 xfs_ino_t ino = XFS_AGINO_TO_INO(mp, sbp->sb_agcount -1, agino); 606 xfs_ino_t ino;
610 xfs_perag_t *pag; 607 xfs_perag_t *pag;
611 608
612 /* Calculate how much should be reserved for inodes to meet 609 /* Calculate how much should be reserved for inodes to meet
@@ -621,10 +618,12 @@ xfs_set_inode32(struct xfs_mount *mp)
621 do_div(icount, sbp->sb_agblocks); 618 do_div(icount, sbp->sb_agblocks);
622 max_metadata = icount; 619 max_metadata = icount;
623 } else { 620 } else {
624 max_metadata = sbp->sb_agcount; 621 max_metadata = agcount;
625 } 622 }
626 623
627 for (index = 0; index < sbp->sb_agcount; index++) { 624 agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0);
625
626 for (index = 0; index < agcount; index++) {
628 ino = XFS_AGINO_TO_INO(mp, index, agino); 627 ino = XFS_AGINO_TO_INO(mp, index, agino);
629 628
630 if (ino > XFS_MAXINUMBER_32) { 629 if (ino > XFS_MAXINUMBER_32) {
@@ -649,11 +648,11 @@ xfs_set_inode32(struct xfs_mount *mp)
649} 648}
650 649
651xfs_agnumber_t 650xfs_agnumber_t
652xfs_set_inode64(struct xfs_mount *mp) 651xfs_set_inode64(struct xfs_mount *mp, xfs_agnumber_t agcount)
653{ 652{
654 xfs_agnumber_t index = 0; 653 xfs_agnumber_t index = 0;
655 654
656 for (index = 0; index < mp->m_sb.sb_agcount; index++) { 655 for (index = 0; index < agcount; index++) {
657 struct xfs_perag *pag; 656 struct xfs_perag *pag;
658 657
659 pag = xfs_perag_get(mp, index); 658 pag = xfs_perag_get(mp, index);
@@ -1189,6 +1188,7 @@ xfs_fs_remount(
1189 char *options) 1188 char *options)
1190{ 1189{
1191 struct xfs_mount *mp = XFS_M(sb); 1190 struct xfs_mount *mp = XFS_M(sb);
1191 xfs_sb_t *sbp = &mp->m_sb;
1192 substring_t args[MAX_OPT_ARGS]; 1192 substring_t args[MAX_OPT_ARGS];
1193 char *p; 1193 char *p;
1194 int error; 1194 int error;
@@ -1209,10 +1209,10 @@ xfs_fs_remount(
1209 mp->m_flags &= ~XFS_MOUNT_BARRIER; 1209 mp->m_flags &= ~XFS_MOUNT_BARRIER;
1210 break; 1210 break;
1211 case Opt_inode64: 1211 case Opt_inode64:
1212 mp->m_maxagi = xfs_set_inode64(mp); 1212 mp->m_maxagi = xfs_set_inode64(mp, sbp->sb_agcount);
1213 break; 1213 break;
1214 case Opt_inode32: 1214 case Opt_inode32:
1215 mp->m_maxagi = xfs_set_inode32(mp); 1215 mp->m_maxagi = xfs_set_inode32(mp, sbp->sb_agcount);
1216 break; 1216 break;
1217 default: 1217 default:
1218 /* 1218 /*