diff options
-rw-r--r-- | Documentation/filesystems/ocfs2.txt | 4 | ||||
-rw-r--r-- | fs/ocfs2/ocfs2.h | 1 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.c | 5 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 17 |
4 files changed, 25 insertions, 2 deletions
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index c318a8bbb1ef..6acf1b4f2466 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt | |||
@@ -76,3 +76,7 @@ localalloc=8(*) Allows custom localalloc size in MB. If the value is too | |||
76 | large, the fs will silently revert it to the default. | 76 | large, the fs will silently revert it to the default. |
77 | Localalloc is not enabled for local mounts. | 77 | Localalloc is not enabled for local mounts. |
78 | localflocks This disables cluster aware flock. | 78 | localflocks This disables cluster aware flock. |
79 | inode64 Indicates that Ocfs2 is allowed to create inodes at | ||
80 | any location in the filesystem, including those which | ||
81 | will result in inode numbers occupying more than 32 | ||
82 | bits of significance. | ||
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 6d3c10ddf489..78ae4f87e6b0 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -189,6 +189,7 @@ enum ocfs2_mount_options | |||
189 | OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ | 189 | OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */ |
190 | OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */ | 190 | OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */ |
191 | OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */ | 191 | OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */ |
192 | OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */ | ||
192 | }; | 193 | }; |
193 | 194 | ||
194 | #define OCFS2_OSB_SOFT_RO 0x0001 | 195 | #define OCFS2_OSB_SOFT_RO 0x0001 |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 213bdca16fe4..d7a6f928c317 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -601,9 +601,10 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb, | |||
601 | /* | 601 | /* |
602 | * stat(2) can't handle i_ino > 32bits, so we tell the | 602 | * stat(2) can't handle i_ino > 32bits, so we tell the |
603 | * lower levels not to allocate us a block group past that | 603 | * lower levels not to allocate us a block group past that |
604 | * limit. | 604 | * limit. The 'inode64' mount option avoids this behavior. |
605 | */ | 605 | */ |
606 | (*ac)->ac_max_block = (u32)~0U; | 606 | if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64)) |
607 | (*ac)->ac_max_block = (u32)~0U; | ||
607 | 608 | ||
608 | /* | 609 | /* |
609 | * slot is set when we successfully steal inode from other nodes. | 610 | * slot is set when we successfully steal inode from other nodes. |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index c85e525950a9..1a51c8c53bef 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -157,6 +157,7 @@ enum { | |||
157 | Opt_stack, | 157 | Opt_stack, |
158 | Opt_user_xattr, | 158 | Opt_user_xattr, |
159 | Opt_nouser_xattr, | 159 | Opt_nouser_xattr, |
160 | Opt_inode64, | ||
160 | Opt_err, | 161 | Opt_err, |
161 | }; | 162 | }; |
162 | 163 | ||
@@ -178,6 +179,7 @@ static const match_table_t tokens = { | |||
178 | {Opt_stack, "cluster_stack=%s"}, | 179 | {Opt_stack, "cluster_stack=%s"}, |
179 | {Opt_user_xattr, "user_xattr"}, | 180 | {Opt_user_xattr, "user_xattr"}, |
180 | {Opt_nouser_xattr, "nouser_xattr"}, | 181 | {Opt_nouser_xattr, "nouser_xattr"}, |
182 | {Opt_inode64, "inode64"}, | ||
181 | {Opt_err, NULL} | 183 | {Opt_err, NULL} |
182 | }; | 184 | }; |
183 | 185 | ||
@@ -411,6 +413,15 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data) | |||
411 | goto out; | 413 | goto out; |
412 | } | 414 | } |
413 | 415 | ||
416 | /* Probably don't want this on remount; it might | ||
417 | * mess with other nodes */ | ||
418 | if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) && | ||
419 | (parsed_options.mount_opt & OCFS2_MOUNT_INODE64)) { | ||
420 | ret = -EINVAL; | ||
421 | mlog(ML_ERROR, "Cannot enable inode64 on remount\n"); | ||
422 | goto out; | ||
423 | } | ||
424 | |||
414 | /* We're going to/from readonly mode. */ | 425 | /* We're going to/from readonly mode. */ |
415 | if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) { | 426 | if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) { |
416 | /* Lock here so the check of HARD_RO and the potential | 427 | /* Lock here so the check of HARD_RO and the potential |
@@ -930,6 +941,9 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
930 | OCFS2_STACK_LABEL_LEN); | 941 | OCFS2_STACK_LABEL_LEN); |
931 | mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; | 942 | mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; |
932 | break; | 943 | break; |
944 | case Opt_inode64: | ||
945 | mopt->mount_opt |= OCFS2_MOUNT_INODE64; | ||
946 | break; | ||
933 | default: | 947 | default: |
934 | mlog(ML_ERROR, | 948 | mlog(ML_ERROR, |
935 | "Unrecognized mount option \"%s\" " | 949 | "Unrecognized mount option \"%s\" " |
@@ -994,6 +1008,9 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt) | |||
994 | seq_printf(s, ",cluster_stack=%.*s", OCFS2_STACK_LABEL_LEN, | 1008 | seq_printf(s, ",cluster_stack=%.*s", OCFS2_STACK_LABEL_LEN, |
995 | osb->osb_cluster_stack); | 1009 | osb->osb_cluster_stack); |
996 | 1010 | ||
1011 | if (opts & OCFS2_MOUNT_INODE64) | ||
1012 | seq_printf(s, ",inode64"); | ||
1013 | |||
997 | return 0; | 1014 | return 0; |
998 | } | 1015 | } |
999 | 1016 | ||