summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorCarlos Maiolino <cmaiolino@redhat.com>2012-09-20 10:32:40 -0300
committerBen Myers <bpm@sgi.com>2012-09-26 15:59:50 -0500
commit4056c1d08d2a7c50ae7414db7c1783ba45b4835d (patch)
tree35f898a661ba5bb100b14b84e56f434bc51bf6e3 /fs/xfs/xfs_super.c
parent4c0837224c677db35cd85b04a77504c496cadb66 (diff)
downloadlinux-4056c1d08d2a7c50ae7414db7c1783ba45b4835d.tar.gz
linux-4056c1d08d2a7c50ae7414db7c1783ba45b4835d.tar.bz2
linux-4056c1d08d2a7c50ae7414db7c1783ba45b4835d.zip
xfs: add inode64->inode32 transition into xfs_set_inode32()
To make inode32 a remountable option, xfs_set_inode32() should be able to make a transition from inode64 option, disabling inode allocation on higher AGs. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index aeb03f9a8967..168d4984ce89 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -603,6 +603,7 @@ xfs_agnumber_t
xfs_set_inode32(struct xfs_mount *mp)
{
xfs_agnumber_t index = 0;
+ xfs_agnumber_t maxagi = 0;
xfs_sb_t *sbp = &mp->m_sb;
xfs_agnumber_t max_metadata;
xfs_agino_t agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks -1, 0);
@@ -626,18 +627,26 @@ xfs_set_inode32(struct xfs_mount *mp)
for (index = 0; index < sbp->sb_agcount; index++) {
ino = XFS_AGINO_TO_INO(mp, index, agino);
+
if (ino > XFS_MAXINUMBER_32) {
- index++;
- break;
+ pag = xfs_perag_get(mp, index);
+ pag->pagi_inodeok = 0;
+ pag->pagf_metadata = 0;
+ xfs_perag_put(pag);
+ continue;
}
pag = xfs_perag_get(mp, index);
pag->pagi_inodeok = 1;
+ maxagi++;
if (index < max_metadata)
pag->pagf_metadata = 1;
xfs_perag_put(pag);
}
- return index;
+ mp->m_flags |= (XFS_MOUNT_32BITINODES |
+ XFS_MOUNT_SMALL_INUMS);
+
+ return maxagi;
}
xfs_agnumber_t