diff options
author | Carlos Maiolino <cmaiolino@redhat.com> | 2012-08-17 17:19:38 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-09-26 16:41:39 -0400 |
commit | c3a58fecdd1934a8538ada9073107625f5151687 (patch) | |
tree | 96f2aa96d890e22266dfd961e569ec11bd3251b5 /fs/xfs | |
parent | 4026c9fde9c67266932afd209e25bfef4474a1be (diff) |
Make inode64 a remountable option
Actually, there is no reason about why a user must umount and mount a
XFS filesystem to enable 'inode64' option. So, this patch makes this a
remountable option.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_super.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 19e2380fb867..c416a01fcb14 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -120,12 +120,13 @@ mempool_t *xfs_ioend_pool; | |||
120 | * in the future, too. | 120 | * in the future, too. |
121 | */ | 121 | */ |
122 | enum { | 122 | enum { |
123 | Opt_barrier, Opt_nobarrier, Opt_err | 123 | Opt_barrier, Opt_nobarrier, Opt_inode64, Opt_err |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static const match_table_t tokens = { | 126 | static const match_table_t tokens = { |
127 | {Opt_barrier, "barrier"}, | 127 | {Opt_barrier, "barrier"}, |
128 | {Opt_nobarrier, "nobarrier"}, | 128 | {Opt_nobarrier, "nobarrier"}, |
129 | {Opt_inode64, "inode64"}, | ||
129 | {Opt_err, NULL} | 130 | {Opt_err, NULL} |
130 | }; | 131 | }; |
131 | 132 | ||
@@ -1031,6 +1032,30 @@ xfs_restore_resvblks(struct xfs_mount *mp) | |||
1031 | xfs_reserve_blocks(mp, &resblks, NULL); | 1032 | xfs_reserve_blocks(mp, &resblks, NULL); |
1032 | } | 1033 | } |
1033 | 1034 | ||
1035 | STATIC void | ||
1036 | xfs_set_inode64(struct xfs_mount *mp) | ||
1037 | { | ||
1038 | int i = 0; | ||
1039 | |||
1040 | for (i = 0; i < mp->m_sb.sb_agcount; i++) { | ||
1041 | struct xfs_perag *pag; | ||
1042 | |||
1043 | pag = xfs_perag_get(mp, i); | ||
1044 | pag->pagi_inodeok = 1; | ||
1045 | pag->pagf_metadata = 0; | ||
1046 | xfs_perag_put(pag); | ||
1047 | } | ||
1048 | |||
1049 | /* There is no need for lock protection on m_flags, | ||
1050 | * the rw_semaphore of the VFS superblock is locked | ||
1051 | * during mount/umount/remount operations, so this is | ||
1052 | * enough to avoid concurency on the m_flags field | ||
1053 | */ | ||
1054 | mp->m_flags &= ~(XFS_MOUNT_32BITINODES | | ||
1055 | XFS_MOUNT_SMALL_INUMS); | ||
1056 | mp->m_maxagi = i; | ||
1057 | } | ||
1058 | |||
1034 | STATIC int | 1059 | STATIC int |
1035 | xfs_fs_remount( | 1060 | xfs_fs_remount( |
1036 | struct super_block *sb, | 1061 | struct super_block *sb, |
@@ -1056,6 +1081,9 @@ xfs_fs_remount( | |||
1056 | case Opt_nobarrier: | 1081 | case Opt_nobarrier: |
1057 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 1082 | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
1058 | break; | 1083 | break; |
1084 | case Opt_inode64: | ||
1085 | xfs_set_inode64(mp); | ||
1086 | break; | ||
1059 | default: | 1087 | default: |
1060 | /* | 1088 | /* |
1061 | * Logically we would return an error here to prevent | 1089 | * Logically we would return an error here to prevent |