diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-09-18 19:38:22 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-09-18 19:38:22 -0400 |
commit | 9345f02671fd39cad69338080b62e12e8b86671d (patch) | |
tree | b447a85dbebfbb2429fac4907fdd44da3986e9c4 /lib | |
parent | 61ef2474c24c80a5bf0e24ba85a7506fd7651a5c (diff) | |
download | e2fsprogs-9345f02671fd39cad69338080b62e12e8b86671d.tar.gz |
tune2fs, debugfs, libext2fs: Add support for ext4 default mount options
Add support for 2.6.35's new default mount options which can be
specified in the superblock.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/e2p/ls.c | 2 | ||||
-rw-r--r-- | lib/e2p/mntopts.c | 4 | ||||
-rw-r--r-- | lib/ext2fs/ext2_fs.h | 9 | ||||
-rw-r--r-- | lib/ext2fs/tst_super_size.c | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index f2a04ffa..5ef80988 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -211,6 +211,8 @@ void list_super2(struct ext2_super_block * sb, FILE *f) 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"); diff --git a/lib/e2p/mntopts.c b/lib/e2p/mntopts.c index bffcb418..ebab7fdf 100644 --- a/lib/e2p/mntopts.c +++ b/lib/e2p/mntopts.c @@ -31,6 +31,10 @@ static struct mntopt mntopt_list[] = { { 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 }, }; diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index a2bca3d6..afd33a93 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -612,8 +612,9 @@ struct ext2_super_block { __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) @@ -710,6 +711,10 @@ struct ext2_super_block { #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 diff --git a/lib/ext2fs/tst_super_size.c b/lib/ext2fs/tst_super_size.c index 606479ca..eb9114f1 100644 --- a/lib/ext2fs/tst_super_size.c +++ b/lib/ext2fs/tst_super_size.c @@ -122,6 +122,7 @@ void check_superblock_fields() 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 |