From 4a959fe6f18a3b6023234a66f4455f7ec660b8b4 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 20 Oct 2002 01:52:52 -0400 Subject: [PATCH] Add support for new default mount options for the journal data mode. --- lib/e2p/ChangeLog | 5 +++++ lib/e2p/e2p.h | 2 +- lib/e2p/ls.c | 8 +++++++- lib/e2p/mntopts.c | 9 +++++++-- lib/ext2fs/ChangeLog | 3 +++ lib/ext2fs/ext2_fs.h | 4 ++++ 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index f3a9b70..8c10fc1 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,5 +1,10 @@ 2002-10-20 Theodore Ts'o + * e2p.h (e2p_string2mntopt), mntopts.c, ls.c (print_mntopts): + Remove unneeded "compat" argument to e2p_string2mntopt(). + Add mount options for the journal data mode (journaled, + ordered, writeback). + * feature.c, ls.c (list_super2): Add support for the meta_blockgroup filesystem format. diff --git a/lib/e2p/e2p.h b/lib/e2p/e2p.h index d76155c..ebd30ab 100644 --- a/lib/e2p/e2p.h +++ b/lib/e2p/e2p.h @@ -42,6 +42,6 @@ const char *e2p_uuid2str(void *uu); const char *e2p_hash2string(int num); int e2p_string2hash(char *string); -const char *e2p_mntopt2string(int compat, unsigned int mask); +const char *e2p_mntopt2string(unsigned int mask); int e2p_string2mntopt(char *string, unsigned int *mask); int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok); diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index cab3ae1..cc3e3ca 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -119,9 +119,15 @@ static void print_mntopts(struct ext2_super_block * s, FILE *f) __u32 mask = s->s_default_mount_opts, m; fprintf(f, "Default mount options: "); + if (mask & EXT3_DEFM_JMODE) { + fprintf(f, " %s", e2p_mntopt2string(mask & EXT3_DEFM_JMODE)); + printed++; + } for (i=0,m=1; i < 32; i++, m<<=1) { + if (m & EXT3_DEFM_JMODE) + continue; if (mask & m) { - fprintf(f, " %s", e2p_mntopt2string(i, m)); + fprintf(f, " %s", e2p_mntopt2string(m)); printed++; } } diff --git a/lib/e2p/mntopts.c b/lib/e2p/mntopts.c index 5db363e..6d0eca0 100644 --- a/lib/e2p/mntopts.c +++ b/lib/e2p/mntopts.c @@ -27,10 +27,13 @@ static struct mntopt mntopt_list[] = { { EXT2_DEFM_XATTR_USER, "user_xattr" }, { EXT2_DEFM_ACL, "acl" }, { EXT2_DEFM_UID16, "uid16" }, - { 0, 0 }, + { EXT3_DEFM_JMODE_DATA, "journal_data" }, + { EXT3_DEFM_JMODE_ORDERED, "journal_data_ordered" }, + { EXT3_DEFM_JMODE_WBACK, "journal_data_writeback" }, + { 0, 0 }, }; -const char *e2p_mntopt2string(int compat, unsigned int mask) +const char *e2p_mntopt2string(unsigned int mask) { struct mntopt *f; static char buf[20]; @@ -121,6 +124,8 @@ int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok) return 1; if (ok && !(ok & mask)) return 1; + if (mask & EXT3_DEFM_JMODE) + *mntopts &= ~EXT3_DEFM_JMODE; if (neg) *mntopts &= ~mask; else diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 7d085e1..5d0974f 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,8 @@ 2002-10-20 Theodore Ts'o + * ext2_fs.h (EXT3_DEFM_JMODE): Add new default mount options for + the journal data mode. + * closefs.c (ext2fs_flush, write_bgdesc), ext2_fs.h, ext2fs.h, openfs.c (ext2fs_descriptor_block_loc, ext2fs_open), initialize.c (ext2fs_initialize), swapfs.c (ext2fs_swap_super): Add support for diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 2b11261..ca53902 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -511,6 +511,10 @@ struct ext2_super_block { #define EXT2_DEFM_XATTR_USER 0x0004 #define EXT2_DEFM_ACL 0x0008 #define EXT2_DEFM_UID16 0x0010 +#define EXT3_DEFM_JMODE 0x0060 +#define EXT3_DEFM_JMODE_DATA 0x0020 +#define EXT3_DEFM_JMODE_ORDERED 0x0040 +#define EXT3_DEFM_JMODE_WBACK 0x0060 /* * Structure of a directory entry -- 1.8.3.1