{ "snapshot_r_blocks_count", &set_sb.s_snapshot_r_blocks_count, 8,
parse_uint },
{ "snapshot_list", &set_sb.s_snapshot_list, 4, parse_uint },
+ { "mount_opts", &set_sb.s_mount_opts, 64, parse_string },
{ 0, 0, 0, 0 }
};
print_features(sb, f);
print_super_flags(sb, f);
print_mntopts(sb, f);
+ if (sb->s_mount_opts[0])
+ fprintf(f, "Mount options: %s\n", sb->s_mount_opts);
fprintf(f, "Filesystem state: ");
print_fs_state (f, sb->s_state);
fprintf(f, "\n");
{ EXT3_DEFM_JMODE_DATA, "journal_data" },
{ EXT3_DEFM_JMODE_ORDERED, "journal_data_ordered" },
{ EXT3_DEFM_JMODE_WBACK, "journal_data_writeback" },
+ { EXT4_DEFM_NOBARRIER, "nobarrier" },
+ { EXT4_DEFM_BLOCK_VALIDITY, "block_validity" },
+ { EXT4_DEFM_DISCARD, "discard"},
+ { EXT4_DEFM_NODELALLOC, "nodelalloc"},
{ 0, 0 },
};
__u32 s_last_error_line; /* line number where error happened */
__u64 s_last_error_block; /* block involved of last error */
__u8 s_last_error_func[32]; /* function where the error happened */
-#define EXT4_S_ERR_END ext4_offsetof(struct ext2_super_block, s_error_count)
- __u32 s_reserved[128]; /* Padding to the end of the block */
+#define EXT4_S_ERR_END ext4_offsetof(struct ext2_super_block, s_mount_opts)
+ __u8 s_mount_opts[64];
+ __u32 s_reserved[112]; /* Padding to the end of the block */
};
#define EXT4_S_ERR_LEN (EXT4_S_ERR_END - EXT4_S_ERR_START)
#define EXT3_DEFM_JMODE_DATA 0x0020
#define EXT3_DEFM_JMODE_ORDERED 0x0040
#define EXT3_DEFM_JMODE_WBACK 0x0060
+#define EXT4_DEFM_NOBARRIER 0x0100
+#define EXT4_DEFM_BLOCK_VALIDITY 0x0200
+#define EXT4_DEFM_DISCARD 0x0400
+#define EXT4_DEFM_NODELALLOC 0x0800
/*
* Structure of a directory entry
check_field(s_last_error_line);
check_field(s_last_error_block);
check_field(s_last_error_func);
+ check_field(s_mount_opts);
check_field(s_reserved);
printf("Ending offset is %d\n\n", cur_offset);
#endif
and
.IR tea .
.TP
+.BI mount_opts= mount_option_string
+Set a set of default mount options which will be used when the file
+system is mounted. Unlike the bitmask-based default mount options which
+can be specified with the
+.B -o
+option,
+.I mount_option_string
+is an arbitrary string with a maximum length of 63 bytes, which is
+stored in the superblock.
+.IP
+The ext4 file system driver will first apply
+the bitmask-based default options, and then parse the
+.IR mount_option_string ,
+before parsing the mount options passed from the
+.BR mount (8)
+program.
+.IP
+This superblock setting is only honored in 2.6.35+ kernels;
+and not at all by the ext2 and ext3 file system drivers.
+.TP
.B test_fs
Set a flag in the filesystem superblock indicating that it may be
mounted using experimental kernel code, such as the ext4dev filesystem.
written into the main filesystem after its metadata has been committed
to the journal. This may increase throughput, however, it may allow old
data to appear in files after a crash and journal recovery.
+.TP
+.B nobarrier
+The file system will be mounted with barrier operations in the journal
+disabled. (This option is currently only supported by the ext4 file
+system driver in 2.6.35+ kernels.)
+.TP
+.B block_validity
+The file system will be mounted with the block_validity option enabled,
+which causes extra checks to be performed after reading or writing from
+the file system. This prevents corrupted metadata blocks from causing
+file system damage by overwriting parts of the inode table or block
+group descriptors. This comes at the cost of increased memory and CPU
+overhead, so it is enabled only for debugging purposes. (This option is
+currently only supported by the ext4 file system driver in 2.6.35+
+kernels.)
+.TP
+.B discard
+The file system will be mouinted with the discard mount option. This will
+cause the file system driver to attempt to use the trim/discard feature
+of some storage devices (such as SSD's and thin-provisioned drives
+available in some enterprise storage arrays) to inform the storage
+device that blocks belonging to deleted files can be reused for other
+purposes. (This option is currently only supported by the ext4 file
+system driver in 2.6.35+ kernels.)
+.TP
+.B nodelalloc
+The file system will be mounted with the nodelalloc mount option. This
+will disable the delayed allocation feature. (This option is currently
+only supported by the ext4 file system driver in 2.6.35+ kernels.)
.RE
.TP
.BR \-O " [^]\fIfeature\fR[,...]"
"to %s (%d)\n"),
arg, hash_alg);
ext2fs_mark_super_dirty(fs);
+ } else if (strcmp(token, "mount-options")) {
+ if (!arg) {
+ r_usage++;
+ continue;
+ }
+ if (strlen(arg) >= sizeof(fs->super->s_mount_opts)) {
+ fprintf(stderr,
+ "Extended mount options too long\n");
+ continue;
+ }
+ strcpy(fs->super->s_mount_opts, arg);
+ ext2fs_mark_super_dirty(fs);
} else
r_usage++;
}