Add support for new default mount options for the journal data mode.

This commit is contained in:
Theodore Ts'o 2002-10-20 01:52:52 -04:00
parent a49929b656
commit 4a959fe6f1
6 changed files with 27 additions and 4 deletions

View 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.

View 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);

View 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++;
}
}

View File

@ -27,10 +27,13 @@ static struct mntopt mntopt_list[] = {
{ EXT2_DEFM_XATTR_USER, "user_xattr" },
{ EXT2_DEFM_ACL, "acl" },
{ EXT2_DEFM_UID16, "uid16" },
{ 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

View 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

View 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