Commit fd8c37ec authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: Simplify the usage of clear_opt() and set_opt() macros

Change clear_opt() and set_opt() to take a superblock pointer instead
of a pointer to EXT4_SB(sb)->s_mount_opt.  This makes it easier for us
to support a second mount option field.
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent b0c3844d
...@@ -917,8 +917,10 @@ struct ext4_inode_info { ...@@ -917,8 +917,10 @@ struct ext4_inode_info {
#define EXT4_MOUNT_DISCARD 0x40000000 /* Issue DISCARD requests */ #define EXT4_MOUNT_DISCARD 0x40000000 /* Issue DISCARD requests */
#define EXT4_MOUNT_INIT_INODE_TABLE 0x80000000 /* Initialize uninitialized itables */ #define EXT4_MOUNT_INIT_INODE_TABLE 0x80000000 /* Initialize uninitialized itables */
#define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt #define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \
#define set_opt(o, opt) o |= EXT4_MOUNT_##opt ~EXT4_MOUNT_##opt
#define set_opt(sb, opt) EXT4_SB(sb)->s_mount_opt |= \
EXT4_MOUNT_##opt
#define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & \ #define test_opt(sb, opt) (EXT4_SB(sb)->s_mount_opt & \
EXT4_MOUNT_##opt) EXT4_MOUNT_##opt)
......
...@@ -2617,7 +2617,7 @@ static inline int ext4_issue_discard(struct super_block *sb, ...@@ -2617,7 +2617,7 @@ static inline int ext4_issue_discard(struct super_block *sb,
ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0); ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
if (ret == -EOPNOTSUPP) { if (ret == -EOPNOTSUPP) {
ext4_warning(sb, "discard not supported, disabling"); ext4_warning(sb, "discard not supported, disabling");
clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); clear_opt(sb, DISCARD);
} }
return ret; return ret;
} }
......
...@@ -1386,7 +1386,7 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args) ...@@ -1386,7 +1386,7 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args)
sbi->s_qf_names[qtype] = NULL; sbi->s_qf_names[qtype] = NULL;
return 0; return 0;
} }
set_opt(sbi->s_mount_opt, QUOTA); set_opt(sb, QUOTA);
return 1; return 1;
} }
...@@ -1441,21 +1441,21 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1441,21 +1441,21 @@ static int parse_options(char *options, struct super_block *sb,
switch (token) { switch (token) {
case Opt_bsd_df: case Opt_bsd_df:
ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
clear_opt(sbi->s_mount_opt, MINIX_DF); clear_opt(sb, MINIX_DF);
break; break;
case Opt_minix_df: case Opt_minix_df:
ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
set_opt(sbi->s_mount_opt, MINIX_DF); set_opt(sb, MINIX_DF);
break; break;
case Opt_grpid: case Opt_grpid:
ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
set_opt(sbi->s_mount_opt, GRPID); set_opt(sb, GRPID);
break; break;
case Opt_nogrpid: case Opt_nogrpid:
ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
clear_opt(sbi->s_mount_opt, GRPID); clear_opt(sb, GRPID);
break; break;
case Opt_resuid: case Opt_resuid:
...@@ -1473,38 +1473,38 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1473,38 +1473,38 @@ static int parse_options(char *options, struct super_block *sb,
/* *sb_block = match_int(&args[0]); */ /* *sb_block = match_int(&args[0]); */
break; break;
case Opt_err_panic: case Opt_err_panic:
clear_opt(sbi->s_mount_opt, ERRORS_CONT); clear_opt(sb, ERRORS_CONT);
clear_opt(sbi->s_mount_opt, ERRORS_RO); clear_opt(sb, ERRORS_RO);
set_opt(sbi->s_mount_opt, ERRORS_PANIC); set_opt(sb, ERRORS_PANIC);
break; break;
case Opt_err_ro: case Opt_err_ro:
clear_opt(sbi->s_mount_opt, ERRORS_CONT); clear_opt(sb, ERRORS_CONT);
clear_opt(sbi->s_mount_opt, ERRORS_PANIC); clear_opt(sb, ERRORS_PANIC);
set_opt(sbi->s_mount_opt, ERRORS_RO); set_opt(sb, ERRORS_RO);
break; break;
case Opt_err_cont: case Opt_err_cont:
clear_opt(sbi->s_mount_opt, ERRORS_RO); clear_opt(sb, ERRORS_RO);
clear_opt(sbi->s_mount_opt, ERRORS_PANIC); clear_opt(sb, ERRORS_PANIC);
set_opt(sbi->s_mount_opt, ERRORS_CONT); set_opt(sb, ERRORS_CONT);
break; break;
case Opt_nouid32: case Opt_nouid32:
set_opt(sbi->s_mount_opt, NO_UID32); set_opt(sb, NO_UID32);
break; break;
case Opt_debug: case Opt_debug:
set_opt(sbi->s_mount_opt, DEBUG); set_opt(sb, DEBUG);
break; break;
case Opt_oldalloc: case Opt_oldalloc:
set_opt(sbi->s_mount_opt, OLDALLOC); set_opt(sb, OLDALLOC);
break; break;
case Opt_orlov: case Opt_orlov:
clear_opt(sbi->s_mount_opt, OLDALLOC); clear_opt(sb, OLDALLOC);
break; break;
#ifdef CONFIG_EXT4_FS_XATTR #ifdef CONFIG_EXT4_FS_XATTR
case Opt_user_xattr: case Opt_user_xattr:
set_opt(sbi->s_mount_opt, XATTR_USER); set_opt(sb, XATTR_USER);
break; break;
case Opt_nouser_xattr: case Opt_nouser_xattr:
clear_opt(sbi->s_mount_opt, XATTR_USER); clear_opt(sb, XATTR_USER);
break; break;
#else #else
case Opt_user_xattr: case Opt_user_xattr:
...@@ -1514,10 +1514,10 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1514,10 +1514,10 @@ static int parse_options(char *options, struct super_block *sb,
#endif #endif
#ifdef CONFIG_EXT4_FS_POSIX_ACL #ifdef CONFIG_EXT4_FS_POSIX_ACL
case Opt_acl: case Opt_acl:
set_opt(sbi->s_mount_opt, POSIX_ACL); set_opt(sb, POSIX_ACL);
break; break;
case Opt_noacl: case Opt_noacl:
clear_opt(sbi->s_mount_opt, POSIX_ACL); clear_opt(sb, POSIX_ACL);
break; break;
#else #else
case Opt_acl: case Opt_acl:
...@@ -1536,7 +1536,7 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1536,7 +1536,7 @@ static int parse_options(char *options, struct super_block *sb,
"Cannot specify journal on remount"); "Cannot specify journal on remount");
return 0; return 0;
} }
set_opt(sbi->s_mount_opt, UPDATE_JOURNAL); set_opt(sb, UPDATE_JOURNAL);
break; break;
case Opt_journal_dev: case Opt_journal_dev:
if (is_remount) { if (is_remount) {
...@@ -1549,14 +1549,14 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1549,14 +1549,14 @@ static int parse_options(char *options, struct super_block *sb,
*journal_devnum = option; *journal_devnum = option;
break; break;
case Opt_journal_checksum: case Opt_journal_checksum:
set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); set_opt(sb, JOURNAL_CHECKSUM);
break; break;
case Opt_journal_async_commit: case Opt_journal_async_commit:
set_opt(sbi->s_mount_opt, JOURNAL_ASYNC_COMMIT); set_opt(sb, JOURNAL_ASYNC_COMMIT);
set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); set_opt(sb, JOURNAL_CHECKSUM);
break; break;
case Opt_noload: case Opt_noload:
set_opt(sbi->s_mount_opt, NOLOAD); set_opt(sb, NOLOAD);
break; break;
case Opt_commit: case Opt_commit:
if (match_int(&args[0], &option)) if (match_int(&args[0], &option))
...@@ -1599,15 +1599,15 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1599,15 +1599,15 @@ static int parse_options(char *options, struct super_block *sb,
return 0; return 0;
} }
} else { } else {
clear_opt(sbi->s_mount_opt, DATA_FLAGS); clear_opt(sb, DATA_FLAGS);
sbi->s_mount_opt |= data_opt; sbi->s_mount_opt |= data_opt;
} }
break; break;
case Opt_data_err_abort: case Opt_data_err_abort:
set_opt(sbi->s_mount_opt, DATA_ERR_ABORT); set_opt(sb, DATA_ERR_ABORT);
break; break;
case Opt_data_err_ignore: case Opt_data_err_ignore:
clear_opt(sbi->s_mount_opt, DATA_ERR_ABORT); clear_opt(sb, DATA_ERR_ABORT);
break; break;
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
case Opt_usrjquota: case Opt_usrjquota:
...@@ -1647,12 +1647,12 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1647,12 +1647,12 @@ static int parse_options(char *options, struct super_block *sb,
break; break;
case Opt_quota: case Opt_quota:
case Opt_usrquota: case Opt_usrquota:
set_opt(sbi->s_mount_opt, QUOTA); set_opt(sb, QUOTA);
set_opt(sbi->s_mount_opt, USRQUOTA); set_opt(sb, USRQUOTA);
break; break;
case Opt_grpquota: case Opt_grpquota:
set_opt(sbi->s_mount_opt, QUOTA); set_opt(sb, QUOTA);
set_opt(sbi->s_mount_opt, GRPQUOTA); set_opt(sb, GRPQUOTA);
break; break;
case Opt_noquota: case Opt_noquota:
if (sb_any_quota_loaded(sb)) { if (sb_any_quota_loaded(sb)) {
...@@ -1660,9 +1660,9 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1660,9 +1660,9 @@ static int parse_options(char *options, struct super_block *sb,
"options when quota turned on"); "options when quota turned on");
return 0; return 0;
} }
clear_opt(sbi->s_mount_opt, QUOTA); clear_opt(sb, QUOTA);
clear_opt(sbi->s_mount_opt, USRQUOTA); clear_opt(sb, USRQUOTA);
clear_opt(sbi->s_mount_opt, GRPQUOTA); clear_opt(sb, GRPQUOTA);
break; break;
#else #else
case Opt_quota: case Opt_quota:
...@@ -1688,7 +1688,7 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1688,7 +1688,7 @@ static int parse_options(char *options, struct super_block *sb,
sbi->s_mount_flags |= EXT4_MF_FS_ABORTED; sbi->s_mount_flags |= EXT4_MF_FS_ABORTED;
break; break;
case Opt_nobarrier: case Opt_nobarrier:
clear_opt(sbi->s_mount_opt, BARRIER); clear_opt(sb, BARRIER);
break; break;
case Opt_barrier: case Opt_barrier:
if (args[0].from) { if (args[0].from) {
...@@ -1697,9 +1697,9 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1697,9 +1697,9 @@ static int parse_options(char *options, struct super_block *sb,
} else } else
option = 1; /* No argument, default to 1 */ option = 1; /* No argument, default to 1 */
if (option) if (option)
set_opt(sbi->s_mount_opt, BARRIER); set_opt(sb, BARRIER);
else else
clear_opt(sbi->s_mount_opt, BARRIER); clear_opt(sb, BARRIER);
break; break;
case Opt_ignore: case Opt_ignore:
break; break;
...@@ -1723,17 +1723,17 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1723,17 +1723,17 @@ static int parse_options(char *options, struct super_block *sb,
"Ignoring deprecated bh option"); "Ignoring deprecated bh option");
break; break;
case Opt_i_version: case Opt_i_version:
set_opt(sbi->s_mount_opt, I_VERSION); set_opt(sb, I_VERSION);
sb->s_flags |= MS_I_VERSION; sb->s_flags |= MS_I_VERSION;
break; break;
case Opt_nodelalloc: case Opt_nodelalloc:
clear_opt(sbi->s_mount_opt, DELALLOC); clear_opt(sb, DELALLOC);
break; break;
case Opt_mblk_io_submit: case Opt_mblk_io_submit:
set_opt(sbi->s_mount_opt, MBLK_IO_SUBMIT); set_opt(sb, MBLK_IO_SUBMIT);
break; break;
case Opt_nomblk_io_submit: case Opt_nomblk_io_submit:
clear_opt(sbi->s_mount_opt, MBLK_IO_SUBMIT); clear_opt(sb, MBLK_IO_SUBMIT);
break; break;
case Opt_stripe: case Opt_stripe:
if (match_int(&args[0], &option)) if (match_int(&args[0], &option))
...@@ -1743,13 +1743,13 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1743,13 +1743,13 @@ static int parse_options(char *options, struct super_block *sb,
sbi->s_stripe = option; sbi->s_stripe = option;
break; break;
case Opt_delalloc: case Opt_delalloc:
set_opt(sbi->s_mount_opt, DELALLOC); set_opt(sb, DELALLOC);
break; break;
case Opt_block_validity: case Opt_block_validity:
set_opt(sbi->s_mount_opt, BLOCK_VALIDITY); set_opt(sb, BLOCK_VALIDITY);
break; break;
case Opt_noblock_validity: case Opt_noblock_validity:
clear_opt(sbi->s_mount_opt, BLOCK_VALIDITY); clear_opt(sb, BLOCK_VALIDITY);
break; break;
case Opt_inode_readahead_blks: case Opt_inode_readahead_blks:
if (match_int(&args[0], &option)) if (match_int(&args[0], &option))
...@@ -1773,7 +1773,7 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1773,7 +1773,7 @@ static int parse_options(char *options, struct super_block *sb,
option); option);
break; break;
case Opt_noauto_da_alloc: case Opt_noauto_da_alloc:
set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); set_opt(sb, NO_AUTO_DA_ALLOC);
break; break;
case Opt_auto_da_alloc: case Opt_auto_da_alloc:
if (args[0].from) { if (args[0].from) {
...@@ -1782,24 +1782,24 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1782,24 +1782,24 @@ static int parse_options(char *options, struct super_block *sb,
} else } else
option = 1; /* No argument, default to 1 */ option = 1; /* No argument, default to 1 */
if (option) if (option)
clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); clear_opt(sb, NO_AUTO_DA_ALLOC);
else else
set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); set_opt(sb,NO_AUTO_DA_ALLOC);
break; break;
case Opt_discard: case Opt_discard:
set_opt(sbi->s_mount_opt, DISCARD); set_opt(sb, DISCARD);
break; break;
case Opt_nodiscard: case Opt_nodiscard:
clear_opt(sbi->s_mount_opt, DISCARD); clear_opt(sb, DISCARD);
break; break;
case Opt_dioread_nolock: case Opt_dioread_nolock:
set_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); set_opt(sb, DIOREAD_NOLOCK);
break; break;
case Opt_dioread_lock: case Opt_dioread_lock:
clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); clear_opt(sb, DIOREAD_NOLOCK);
break; break;
case Opt_init_inode_table: case Opt_init_inode_table:
set_opt(sbi->s_mount_opt, INIT_INODE_TABLE); set_opt(sb, INIT_INODE_TABLE);
if (args[0].from) { if (args[0].from) {
if (match_int(&args[0], &option)) if (match_int(&args[0], &option))
return 0; return 0;
...@@ -1810,7 +1810,7 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1810,7 +1810,7 @@ static int parse_options(char *options, struct super_block *sb,
sbi->s_li_wait_mult = option; sbi->s_li_wait_mult = option;
break; break;
case Opt_noinit_inode_table: case Opt_noinit_inode_table:
clear_opt(sbi->s_mount_opt, INIT_INODE_TABLE); clear_opt(sb, INIT_INODE_TABLE);
break; break;
default: default:
ext4_msg(sb, KERN_ERR, ext4_msg(sb, KERN_ERR,
...@@ -1822,10 +1822,10 @@ static int parse_options(char *options, struct super_block *sb, ...@@ -1822,10 +1822,10 @@ static int parse_options(char *options, struct super_block *sb,
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA]) if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA])
clear_opt(sbi->s_mount_opt, USRQUOTA); clear_opt(sb, USRQUOTA);
if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA]) if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA])
clear_opt(sbi->s_mount_opt, GRPQUOTA); clear_opt(sb, GRPQUOTA);
if (test_opt(sb, GRPQUOTA) || test_opt(sb, USRQUOTA)) { if (test_opt(sb, GRPQUOTA) || test_opt(sb, USRQUOTA)) {
ext4_msg(sb, KERN_ERR, "old and new quota " ext4_msg(sb, KERN_ERR, "old and new quota "
...@@ -3071,41 +3071,41 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3071,41 +3071,41 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
/* Set defaults before we parse the mount options */ /* Set defaults before we parse the mount options */
def_mount_opts = le32_to_cpu(es->s_default_mount_opts); def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
set_opt(sbi->s_mount_opt, INIT_INODE_TABLE); set_opt(sb, INIT_INODE_TABLE);
if (def_mount_opts & EXT4_DEFM_DEBUG) if (def_mount_opts & EXT4_DEFM_DEBUG)
set_opt(sbi->s_mount_opt, DEBUG); set_opt(sb, DEBUG);
if (def_mount_opts & EXT4_DEFM_BSDGROUPS) { if (def_mount_opts & EXT4_DEFM_BSDGROUPS) {
ext4_msg(sb, KERN_WARNING, deprecated_msg, "bsdgroups", ext4_msg(sb, KERN_WARNING, deprecated_msg, "bsdgroups",
"2.6.38"); "2.6.38");
set_opt(sbi->s_mount_opt, GRPID); set_opt(sb, GRPID);
} }
if (def_mount_opts & EXT4_DEFM_UID16) if (def_mount_opts & EXT4_DEFM_UID16)
set_opt(sbi->s_mount_opt, NO_UID32); set_opt(sb, NO_UID32);
#ifdef CONFIG_EXT4_FS_XATTR #ifdef CONFIG_EXT4_FS_XATTR
if (def_mount_opts & EXT4_DEFM_XATTR_USER) if (def_mount_opts & EXT4_DEFM_XATTR_USER)
set_opt(sbi->s_mount_opt, XATTR_USER); set_opt(sb, XATTR_USER);
#endif #endif
#ifdef CONFIG_EXT4_FS_POSIX_ACL #ifdef CONFIG_EXT4_FS_POSIX_ACL
if (def_mount_opts & EXT4_DEFM_ACL) if (def_mount_opts & EXT4_DEFM_ACL)
set_opt(sbi->s_mount_opt, POSIX_ACL); set_opt(sb, POSIX_ACL);
#endif #endif
if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA) if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA)
set_opt(sbi->s_mount_opt, JOURNAL_DATA); set_opt(sb, JOURNAL_DATA);
else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED) else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED)
set_opt(sbi->s_mount_opt, ORDERED_DATA); set_opt(sb, ORDERED_DATA);
else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK) else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK)
set_opt(sbi->s_mount_opt, WRITEBACK_DATA); set_opt(sb, WRITEBACK_DATA);
if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC) if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC)
set_opt(sbi->s_mount_opt, ERRORS_PANIC); set_opt(sb, ERRORS_PANIC);
else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE) else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE)
set_opt(sbi->s_mount_opt, ERRORS_CONT); set_opt(sb, ERRORS_CONT);
else else
set_opt(sbi->s_mount_opt, ERRORS_RO); set_opt(sb, ERRORS_RO);
if (def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY) if (def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY)
set_opt(sbi->s_mount_opt, BLOCK_VALIDITY); set_opt(sb, BLOCK_VALIDITY);
if (def_mount_opts & EXT4_DEFM_DISCARD) if (def_mount_opts & EXT4_DEFM_DISCARD)
set_opt(sbi->s_mount_opt, DISCARD); set_opt(sb, DISCARD);
sbi->s_resuid = le16_to_cpu(es->s_def_resuid); sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
sbi->s_resgid = le16_to_cpu(es->s_def_resgid); sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
...@@ -3114,7 +3114,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3114,7 +3114,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME; sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME;
if ((def_mount_opts & EXT4_DEFM_NOBARRIER) == 0) if ((def_mount_opts & EXT4_DEFM_NOBARRIER) == 0)
set_opt(sbi->s_mount_opt, BARRIER); set_opt(sb, BARRIER);
/* /*
* enable delayed allocation by default * enable delayed allocation by default
...@@ -3122,7 +3122,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3122,7 +3122,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
*/ */
if (!IS_EXT3_SB(sb) && if (!IS_EXT3_SB(sb) &&
((def_mount_opts & EXT4_DEFM_NODELALLOC) == 0)) ((def_mount_opts & EXT4_DEFM_NODELALLOC) == 0))
set_opt(sbi->s_mount_opt, DELALLOC); set_opt(sb, DELALLOC);
if (!parse_options((char *) sbi->s_es->s_mount_opts, sb, if (!parse_options((char *) sbi->s_es->s_mount_opts, sb,
&journal_devnum, &journal_ioprio, NULL, 0)) { &journal_devnum, &journal_ioprio, NULL, 0)) {
...@@ -3425,8 +3425,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3425,8 +3425,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
"suppressed and not mounted read-only"); "suppressed and not mounted read-only");
goto failed_mount_wq; goto failed_mount_wq;
} else { } else {
clear_opt(sbi->s_mount_opt, DATA_FLAGS); clear_opt(sb, DATA_FLAGS);
set_opt(sbi->s_mount_opt, WRITEBACK_DATA); set_opt(sb, WRITEBACK_DATA);
sbi->s_journal = NULL; sbi->s_journal = NULL;
needs_recovery = 0; needs_recovery = 0;
goto no_journal; goto no_journal;
...@@ -3464,9 +3464,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3464,9 +3464,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
*/ */
if (jbd2_journal_check_available_features if (jbd2_journal_check_available_features
(sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE))
set_opt(sbi->s_mount_opt, ORDERED_DATA); set_opt(sb, ORDERED_DATA);
else else
set_opt(sbi->s_mount_opt, JOURNAL_DATA); set_opt(sb, JOURNAL_DATA);
break; break;
case EXT4_MOUNT_ORDERED_DATA: case EXT4_MOUNT_ORDERED_DATA:
...@@ -3556,18 +3556,18 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3556,18 +3556,18 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
(test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)) { (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)) {
ext4_msg(sb, KERN_WARNING, "Ignoring delalloc option - " ext4_msg(sb, KERN_WARNING, "Ignoring delalloc option - "
"requested data journaling mode"); "requested data journaling mode");
clear_opt(sbi->s_mount_opt, DELALLOC); clear_opt(sb, DELALLOC);
} }
if (test_opt(sb, DIOREAD_NOLOCK)) { if (test_opt(sb, DIOREAD_NOLOCK)) {
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock " ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock "
"option - requested data journaling mode"); "option - requested data journaling mode");
clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); clear_opt(sb, DIOREAD_NOLOCK);
} }
if (sb->s_blocksize < PAGE_SIZE) { if (sb->s_blocksize < PAGE_SIZE) {
ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock " ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock "
"option - block size is too small"); "option - block size is too small");
clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); clear_opt(sb, DIOREAD_NOLOCK);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment