Whamcloud - gitweb
Add support for new default mount options for the journal data mode.
authorTheodore Ts'o <tytso@mit.edu>
Sun, 20 Oct 2002 05:52:52 +0000 (01:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 20 Oct 2002 05:52:52 +0000 (01:52 -0400)
lib/e2p/ChangeLog
lib/e2p/e2p.h
lib/e2p/ls.c
lib/e2p/mntopts.c
lib/ext2fs/ChangeLog
lib/ext2fs/ext2_fs.h

index f3a9b70..8c10fc1 100644 (file)
@@ -1,5 +1,10 @@
 2002-10-20  Theodore Ts'o  <tytso@valinux.com>
 
+       * 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.
 
index d76155c..ebd30ab 100644 (file)
@@ -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);
index cab3ae1..cc3e3ca 100644 (file)
@@ -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++;
                }
        }
index 5db363e..6d0eca0 100644 (file)
@@ -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
index 7d085e1..5d0974f 100644 (file)
@@ -1,5 +1,8 @@
 2002-10-20  Theodore Ts'o  <tytso@valinux.com>
 
+       * 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
index 2b11261..ca53902 100644 (file)
@@ -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