1 From: Joel Becker <joel.becker@oracle.com>
2 Subject: ocfs2: Add the 'inode64' mount option.
3 Patch-mainline: 2.6.28?
6 Now that ocfs2 limits inode numbers to 32bits, add a mount option to
7 disable the limit. This parallels XFS. 64bit systems can handle the
10 [ Added description of inode64 mount option in ocfs2.txt. --Mark ]
12 Signed-off-by: Joel Becker <joel.becker@oracle.com>
13 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
15 Documentation/filesystems/ocfs2.txt | 4 ++++
16 fs/ocfs2/ocfs2.h | 1 +
17 fs/ocfs2/suballoc.c | 5 +++--
18 fs/ocfs2/super.c | 17 +++++++++++++++++
19 4 files changed, 25 insertions(+), 2 deletions(-)
21 Index: linux-2.6.26/Documentation/filesystems/ocfs2.txt
22 ===================================================================
23 --- linux-2.6.26.orig/Documentation/filesystems/ocfs2.txt
24 +++ linux-2.6.26/Documentation/filesystems/ocfs2.txt
25 @@ -76,3 +76,7 @@ localalloc=8(*) Allows custom localallo
26 large, the fs will silently revert it to the default.
27 Localalloc is not enabled for local mounts.
28 localflocks This disables cluster aware flock.
29 +inode64 Indicates that Ocfs2 is allowed to create inodes at
30 + any location in the filesystem, including those which
31 + will result in inode numbers occupying more than 32
32 + bits of significance.
33 Index: linux-2.6.26/fs/ocfs2/ocfs2.h
34 ===================================================================
35 --- linux-2.6.26.orig/fs/ocfs2/ocfs2.h
36 +++ linux-2.6.26/fs/ocfs2/ocfs2.h
37 @@ -185,6 +185,7 @@ enum ocfs2_mount_options
38 OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
39 OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */
40 OCFS2_MOUNT_NOUSERXATTR = 1 << 6, /* No user xattr */
41 + OCFS2_MOUNT_INODE64 = 1 << 7, /* Allow inode numbers > 2^32 */
44 #define OCFS2_OSB_SOFT_RO 0x0001
45 Index: linux-2.6.26/fs/ocfs2/suballoc.c
46 ===================================================================
47 --- linux-2.6.26.orig/fs/ocfs2/suballoc.c
48 +++ linux-2.6.26/fs/ocfs2/suballoc.c
49 @@ -601,9 +601,10 @@ int ocfs2_reserve_new_inode(struct ocfs2
51 * stat(2) can't handle i_ino > 32bits, so we tell the
52 * lower levels not to allocate us a block group past that
54 + * limit. The 'inode64' mount option avoids this behavior.
56 - (*ac)->ac_max_block = (u32)~0U;
57 + if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64))
58 + (*ac)->ac_max_block = (u32)~0U;
61 * slot is set when we successfully steal inode from other nodes.
62 Index: linux-2.6.26/fs/ocfs2/super.c
63 ===================================================================
64 --- linux-2.6.26.orig/fs/ocfs2/super.c
65 +++ linux-2.6.26/fs/ocfs2/super.c
66 @@ -157,6 +157,7 @@ enum {
74 @@ -178,6 +179,7 @@ static match_table_t tokens = {
75 {Opt_stack, "cluster_stack=%s"},
76 {Opt_user_xattr, "user_xattr"},
77 {Opt_nouser_xattr, "nouser_xattr"},
78 + {Opt_inode64, "inode64"},
82 @@ -411,6 +413,15 @@ static int ocfs2_remount(struct super_bl
86 + /* Probably don't want this on remount; it might
87 + * mess with other nodes */
88 + if (!(osb->s_mount_opt & OCFS2_MOUNT_INODE64) &&
89 + (parsed_options.mount_opt & OCFS2_MOUNT_INODE64)) {
91 + mlog(ML_ERROR, "Cannot enable inode64 on remount\n");
95 /* We're going to/from readonly mode. */
96 if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY)) {
97 /* Lock here so the check of HARD_RO and the potential
98 @@ -929,6 +940,9 @@ static int ocfs2_parse_options(struct su
99 OCFS2_STACK_LABEL_LEN);
100 mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';
103 + mopt->mount_opt |= OCFS2_MOUNT_INODE64;
107 "Unrecognized mount option \"%s\" "
108 @@ -996,6 +1010,9 @@ static int ocfs2_show_options(struct seq
110 seq_printf(s, ",user_xattr");
112 + if (opts & OCFS2_MOUNT_INODE64)
113 + seq_printf(s, ",inode64");