Commit 9a2ad89b authored by Nathan Scott's avatar Nathan Scott Committed by Stephen Lord

[XFS] Add inode64 mount option; fix case where growfs can push 32 bit inodes...

[XFS] Add inode64 mount option; fix case where growfs can push 32 bit inodes into 64 bit space accidentally - both changes originally from IRIX

SGI Modid: 2.5.x-xfs:slinx:157935a
parent 76897d18
......@@ -322,9 +322,11 @@ xfs_initialize_perag(xfs_mount_t *mp, int agcount)
ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino);
/* Clear the mount flag if no inode can overflow 32 bits
* on this filesystem.
* on this filesystem, or if specifically requested..
*/
if (ino <= max_inum) {
if ((mp->m_flags & XFS_MOUNT_32BITINOOPT) && ino > max_inum) {
mp->m_flags |= XFS_MOUNT_32BITINODES;
} else {
mp->m_flags &= ~XFS_MOUNT_32BITINODES;
}
......
......@@ -413,10 +413,11 @@ typedef struct xfs_mount {
#define XFS_MOUNT_DFLT_IOSIZE 0x00001000 /* set default i/o size */
#define XFS_MOUNT_OSYNCISOSYNC 0x00002000 /* o_sync is REALLY o_sync */
/* osyncisdsync is now default*/
#define XFS_MOUNT_NOUUID 0x00004000 /* ignore uuid during mount */
#define XFS_MOUNT_32BITINODES 0x00008000 /* do not create inodes above
#define XFS_MOUNT_32BITINODES 0x00004000 /* do not create inodes above
* 32 bits in size */
#define XFS_MOUNT_NOLOGFLUSH 0x00010000
#define XFS_MOUNT_32BITINOOPT 0x00008000 /* saved mount option state */
#define XFS_MOUNT_NOUUID 0x00010000 /* ignore uuid during mount */
#define XFS_MOUNT_NOLOGFLUSH 0x00020000
/*
* Default minimum read and write sizes.
......
......@@ -283,7 +283,7 @@ xfs_start_flags(
mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC;
if (ap->flags & XFSMNT_32BITINODES)
mp->m_flags |= XFS_MOUNT_32BITINODES;
mp->m_flags |= (XFS_MOUNT_32BITINODES | XFS_MOUNT_32BITINOOPT);
if (ap->flags & XFSMNT_IOSIZE) {
if (ap->iosizelog > XFS_MAX_IO_LOG ||
......@@ -1587,6 +1587,7 @@ xfs_vget(
#define MNTOPT_NORECOVERY "norecovery" /* don't run XFS recovery */
#define MNTOPT_NOLOGFLUSH "nologflush" /* don't hard flush on log writes */
#define MNTOPT_OSYNCISOSYNC "osyncisosync" /* o_sync is REALLY o_sync */
#define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */
int
......@@ -1694,6 +1695,13 @@ xfs_parseargs(
return EINVAL;
}
dswidth = simple_strtoul(value, &eov, 10);
} else if (!strcmp(this_char, MNTOPT_64BITINODE)) {
args->flags &= ~XFSMNT_32BITINODES;
#ifndef XFS_BIG_FILESYSTEMS
printk("XFS: %s option not allowed on this system\n",
MNTOPT_64BITINODE);
return EINVAL;
#endif
} else if (!strcmp(this_char, MNTOPT_NOUUID)) {
args->flags |= XFSMNT_NOUUID;
} else if (!strcmp(this_char, MNTOPT_NOLOGFLUSH)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment