aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-12-15 20:26:48 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-12-15 20:26:48 -0500
commitfd8c37eccdda21153298997417144b38b1623196 (patch)
tree313e022d9d82f890e728dce66ce6e115ea3970b1 /fs/ext4/super.c
parentb0c3844d8af6b9f3f18f31e1b0502fbefa2166be (diff)
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: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c162
1 files changed, 81 insertions, 81 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index fb15c9c0be74..cf7d9131d785 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1386,7 +1386,7 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args)
1386 sbi->s_qf_names[qtype] = NULL; 1386 sbi->s_qf_names[qtype] = NULL;
1387 return 0; 1387 return 0;
1388 } 1388 }
1389 set_opt(sbi->s_mount_opt, QUOTA); 1389 set_opt(sb, QUOTA);
1390 return 1; 1390 return 1;
1391} 1391}
1392 1392
@@ -1441,21 +1441,21 @@ static int parse_options(char *options, struct super_block *sb,
1441 switch (token) { 1441 switch (token) {
1442 case Opt_bsd_df: 1442 case Opt_bsd_df:
1443 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); 1443 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
1444 clear_opt(sbi->s_mount_opt, MINIX_DF); 1444 clear_opt(sb, MINIX_DF);
1445 break; 1445 break;
1446 case Opt_minix_df: 1446 case Opt_minix_df:
1447 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); 1447 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
1448 set_opt(sbi->s_mount_opt, MINIX_DF); 1448 set_opt(sb, MINIX_DF);
1449 1449
1450 break; 1450 break;
1451 case Opt_grpid: 1451 case Opt_grpid:
1452 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); 1452 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
1453 set_opt(sbi->s_mount_opt, GRPID); 1453 set_opt(sb, GRPID);
1454 1454
1455 break; 1455 break;
1456 case Opt_nogrpid: 1456 case Opt_nogrpid:
1457 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38"); 1457 ext4_msg(sb, KERN_WARNING, deprecated_msg, p, "2.6.38");
1458 clear_opt(sbi->s_mount_opt, GRPID); 1458 clear_opt(sb, GRPID);
1459 1459
1460 break; 1460 break;
1461 case Opt_resuid: 1461 case Opt_resuid:
@@ -1473,38 +1473,38 @@ static int parse_options(char *options, struct super_block *sb,
1473 /* *sb_block = match_int(&args[0]); */ 1473 /* *sb_block = match_int(&args[0]); */
1474 break; 1474 break;
1475 case Opt_err_panic: 1475 case Opt_err_panic:
1476 clear_opt(sbi->s_mount_opt, ERRORS_CONT); 1476 clear_opt(sb, ERRORS_CONT);
1477 clear_opt(sbi->s_mount_opt, ERRORS_RO); 1477 clear_opt(sb, ERRORS_RO);
1478 set_opt(sbi->s_mount_opt, ERRORS_PANIC); 1478 set_opt(sb, ERRORS_PANIC);
1479 break; 1479 break;
1480 case Opt_err_ro: 1480 case Opt_err_ro:
1481 clear_opt(sbi->s_mount_opt, ERRORS_CONT); 1481 clear_opt(sb, ERRORS_CONT);
1482 clear_opt(sbi->s_mount_opt, ERRORS_PANIC); 1482 clear_opt(sb, ERRORS_PANIC);
1483 set_opt(sbi->s_mount_opt, ERRORS_RO); 1483 set_opt(sb, ERRORS_RO);
1484 break; 1484 break;
1485 case Opt_err_cont: 1485 case Opt_err_cont:
1486 clear_opt(sbi->s_mount_opt, ERRORS_RO); 1486 clear_opt(sb, ERRORS_RO);
1487 clear_opt(sbi->s_mount_opt, ERRORS_PANIC); 1487 clear_opt(sb, ERRORS_PANIC);
1488 set_opt(sbi->s_mount_opt, ERRORS_CONT); 1488 set_opt(sb, ERRORS_CONT);
1489 break; 1489 break;
1490 case Opt_nouid32: 1490 case Opt_nouid32:
1491 set_opt(sbi->s_mount_opt, NO_UID32); 1491 set_opt(sb, NO_UID32);
1492 break; 1492 break;
1493 case Opt_debug: 1493 case Opt_debug:
1494 set_opt(sbi->s_mount_opt, DEBUG); 1494 set_opt(sb, DEBUG);
1495 break; 1495 break;
1496 case Opt_oldalloc: 1496 case Opt_oldalloc:
1497 set_opt(sbi->s_mount_opt, OLDALLOC); 1497 set_opt(sb, OLDALLOC);
1498 break; 1498 break;
1499 case Opt_orlov: 1499 case Opt_orlov:
1500 clear_opt(sbi->s_mount_opt, OLDALLOC); 1500 clear_opt(sb, OLDALLOC);
1501 break; 1501 break;
1502#ifdef CONFIG_EXT4_FS_XATTR 1502#ifdef CONFIG_EXT4_FS_XATTR
1503 case Opt_user_xattr: 1503 case Opt_user_xattr:
1504 set_opt(sbi->s_mount_opt, XATTR_USER); 1504 set_opt(sb, XATTR_USER);
1505 break; 1505 break;
1506 case Opt_nouser_xattr: 1506 case Opt_nouser_xattr:
1507 clear_opt(sbi->s_mount_opt, XATTR_USER); 1507 clear_opt(sb, XATTR_USER);
1508 break; 1508 break;
1509#else 1509#else
1510 case Opt_user_xattr: 1510 case Opt_user_xattr:
@@ -1514,10 +1514,10 @@ static int parse_options(char *options, struct super_block *sb,
1514#endif 1514#endif
1515#ifdef CONFIG_EXT4_FS_POSIX_ACL 1515#ifdef CONFIG_EXT4_FS_POSIX_ACL
1516 case Opt_acl: 1516 case Opt_acl:
1517 set_opt(sbi->s_mount_opt, POSIX_ACL); 1517 set_opt(sb, POSIX_ACL);
1518 break; 1518 break;
1519 case Opt_noacl: 1519 case Opt_noacl:
1520 clear_opt(sbi->s_mount_opt, POSIX_ACL); 1520 clear_opt(sb, POSIX_ACL);
1521 break; 1521 break;
1522#else 1522#else
1523 case Opt_acl: 1523 case Opt_acl:
@@ -1536,7 +1536,7 @@ static int parse_options(char *options, struct super_block *sb,
1536 "Cannot specify journal on remount"); 1536 "Cannot specify journal on remount");
1537 return 0; 1537 return 0;
1538 } 1538 }
1539 set_opt(sbi->s_mount_opt, UPDATE_JOURNAL); 1539 set_opt(sb, UPDATE_JOURNAL);
1540 break; 1540 break;
1541 case Opt_journal_dev: 1541 case Opt_journal_dev:
1542 if (is_remount) { 1542 if (is_remount) {
@@ -1549,14 +1549,14 @@ static int parse_options(char *options, struct super_block *sb,
1549 *journal_devnum = option; 1549 *journal_devnum = option;
1550 break; 1550 break;
1551 case Opt_journal_checksum: 1551 case Opt_journal_checksum:
1552 set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); 1552 set_opt(sb, JOURNAL_CHECKSUM);
1553 break; 1553 break;
1554 case Opt_journal_async_commit: 1554 case Opt_journal_async_commit:
1555 set_opt(sbi->s_mount_opt, JOURNAL_ASYNC_COMMIT); 1555 set_opt(sb, JOURNAL_ASYNC_COMMIT);
1556 set_opt(sbi->s_mount_opt, JOURNAL_CHECKSUM); 1556 set_opt(sb, JOURNAL_CHECKSUM);
1557 break; 1557 break;
1558 case Opt_noload: 1558 case Opt_noload:
1559 set_opt(sbi->s_mount_opt, NOLOAD); 1559 set_opt(sb, NOLOAD);
1560 break; 1560 break;
1561 case Opt_commit: 1561 case Opt_commit:
1562 if (match_int(&args[0], &option)) 1562 if (match_int(&args[0], &option))
@@ -1599,15 +1599,15 @@ static int parse_options(char *options, struct super_block *sb,
1599 return 0; 1599 return 0;
1600 } 1600 }
1601 } else { 1601 } else {
1602 clear_opt(sbi->s_mount_opt, DATA_FLAGS); 1602 clear_opt(sb, DATA_FLAGS);
1603 sbi->s_mount_opt |= data_opt; 1603 sbi->s_mount_opt |= data_opt;
1604 } 1604 }
1605 break; 1605 break;
1606 case Opt_data_err_abort: 1606 case Opt_data_err_abort:
1607 set_opt(sbi->s_mount_opt, DATA_ERR_ABORT); 1607 set_opt(sb, DATA_ERR_ABORT);
1608 break; 1608 break;
1609 case Opt_data_err_ignore: 1609 case Opt_data_err_ignore:
1610 clear_opt(sbi->s_mount_opt, DATA_ERR_ABORT); 1610 clear_opt(sb, DATA_ERR_ABORT);
1611 break; 1611 break;
1612#ifdef CONFIG_QUOTA 1612#ifdef CONFIG_QUOTA
1613 case Opt_usrjquota: 1613 case Opt_usrjquota:
@@ -1647,12 +1647,12 @@ set_qf_format:
1647 break; 1647 break;
1648 case Opt_quota: 1648 case Opt_quota:
1649 case Opt_usrquota: 1649 case Opt_usrquota:
1650 set_opt(sbi->s_mount_opt, QUOTA); 1650 set_opt(sb, QUOTA);
1651 set_opt(sbi->s_mount_opt, USRQUOTA); 1651 set_opt(sb, USRQUOTA);
1652 break; 1652 break;
1653 case Opt_grpquota: 1653 case Opt_grpquota:
1654 set_opt(sbi->s_mount_opt, QUOTA); 1654 set_opt(sb, QUOTA);
1655 set_opt(sbi->s_mount_opt, GRPQUOTA); 1655 set_opt(sb, GRPQUOTA);
1656 break; 1656 break;
1657 case Opt_noquota: 1657 case Opt_noquota:
1658 if (sb_any_quota_loaded(sb)) { 1658 if (sb_any_quota_loaded(sb)) {
@@ -1660,9 +1660,9 @@ set_qf_format:
1660 "options when quota turned on"); 1660 "options when quota turned on");
1661 return 0; 1661 return 0;
1662 } 1662 }
1663 clear_opt(sbi->s_mount_opt, QUOTA); 1663 clear_opt(sb, QUOTA);
1664 clear_opt(sbi->s_mount_opt, USRQUOTA); 1664 clear_opt(sb, USRQUOTA);
1665 clear_opt(sbi->s_mount_opt, GRPQUOTA); 1665 clear_opt(sb, GRPQUOTA);
1666 break; 1666 break;
1667#else 1667#else
1668 case Opt_quota: 1668 case Opt_quota:
@@ -1688,7 +1688,7 @@ set_qf_format:
1688 sbi->s_mount_flags |= EXT4_MF_FS_ABORTED; 1688 sbi->s_mount_flags |= EXT4_MF_FS_ABORTED;
1689 break; 1689 break;
1690 case Opt_nobarrier: 1690 case Opt_nobarrier:
1691 clear_opt(sbi->s_mount_opt, BARRIER); 1691 clear_opt(sb, BARRIER);
1692 break; 1692 break;
1693 case Opt_barrier: 1693 case Opt_barrier:
1694 if (args[0].from) { 1694 if (args[0].from) {
@@ -1697,9 +1697,9 @@ set_qf_format:
1697 } else 1697 } else
1698 option = 1; /* No argument, default to 1 */ 1698 option = 1; /* No argument, default to 1 */
1699 if (option) 1699 if (option)
1700 set_opt(sbi->s_mount_opt, BARRIER); 1700 set_opt(sb, BARRIER);
1701 else 1701 else
1702 clear_opt(sbi->s_mount_opt, BARRIER); 1702 clear_opt(sb, BARRIER);
1703 break; 1703 break;
1704 case Opt_ignore: 1704 case Opt_ignore:
1705 break; 1705 break;
@@ -1723,17 +1723,17 @@ set_qf_format:
1723 "Ignoring deprecated bh option"); 1723 "Ignoring deprecated bh option");
1724 break; 1724 break;
1725 case Opt_i_version: 1725 case Opt_i_version:
1726 set_opt(sbi->s_mount_opt, I_VERSION); 1726 set_opt(sb, I_VERSION);
1727 sb->s_flags |= MS_I_VERSION; 1727 sb->s_flags |= MS_I_VERSION;
1728 break; 1728 break;
1729 case Opt_nodelalloc: 1729 case Opt_nodelalloc:
1730 clear_opt(sbi->s_mount_opt, DELALLOC); 1730 clear_opt(sb, DELALLOC);
1731 break; 1731 break;
1732 case Opt_mblk_io_submit: 1732 case Opt_mblk_io_submit:
1733 set_opt(sbi->s_mount_opt, MBLK_IO_SUBMIT); 1733 set_opt(sb, MBLK_IO_SUBMIT);
1734 break; 1734 break;
1735 case Opt_nomblk_io_submit: 1735 case Opt_nomblk_io_submit:
1736 clear_opt(sbi->s_mount_opt, MBLK_IO_SUBMIT); 1736 clear_opt(sb, MBLK_IO_SUBMIT);
1737 break; 1737 break;
1738 case Opt_stripe: 1738 case Opt_stripe:
1739 if (match_int(&args[0], &option)) 1739 if (match_int(&args[0], &option))
@@ -1743,13 +1743,13 @@ set_qf_format:
1743 sbi->s_stripe = option; 1743 sbi->s_stripe = option;
1744 break; 1744 break;
1745 case Opt_delalloc: 1745 case Opt_delalloc:
1746 set_opt(sbi->s_mount_opt, DELALLOC); 1746 set_opt(sb, DELALLOC);
1747 break; 1747 break;
1748 case Opt_block_validity: 1748 case Opt_block_validity:
1749 set_opt(sbi->s_mount_opt, BLOCK_VALIDITY); 1749 set_opt(sb, BLOCK_VALIDITY);
1750 break; 1750 break;
1751 case Opt_noblock_validity: 1751 case Opt_noblock_validity:
1752 clear_opt(sbi->s_mount_opt, BLOCK_VALIDITY); 1752 clear_opt(sb, BLOCK_VALIDITY);
1753 break; 1753 break;
1754 case Opt_inode_readahead_blks: 1754 case Opt_inode_readahead_blks:
1755 if (match_int(&args[0], &option)) 1755 if (match_int(&args[0], &option))
@@ -1773,7 +1773,7 @@ set_qf_format:
1773 option); 1773 option);
1774 break; 1774 break;
1775 case Opt_noauto_da_alloc: 1775 case Opt_noauto_da_alloc:
1776 set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); 1776 set_opt(sb, NO_AUTO_DA_ALLOC);
1777 break; 1777 break;
1778 case Opt_auto_da_alloc: 1778 case Opt_auto_da_alloc:
1779 if (args[0].from) { 1779 if (args[0].from) {
@@ -1782,24 +1782,24 @@ set_qf_format:
1782 } else 1782 } else
1783 option = 1; /* No argument, default to 1 */ 1783 option = 1; /* No argument, default to 1 */
1784 if (option) 1784 if (option)
1785 clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); 1785 clear_opt(sb, NO_AUTO_DA_ALLOC);
1786 else 1786 else
1787 set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); 1787 set_opt(sb,NO_AUTO_DA_ALLOC);
1788 break; 1788 break;
1789 case Opt_discard: 1789 case Opt_discard:
1790 set_opt(sbi->s_mount_opt, DISCARD); 1790 set_opt(sb, DISCARD);
1791 break; 1791 break;
1792 case Opt_nodiscard: 1792 case Opt_nodiscard:
1793 clear_opt(sbi->s_mount_opt, DISCARD); 1793 clear_opt(sb, DISCARD);
1794 break; 1794 break;
1795 case Opt_dioread_nolock: 1795 case Opt_dioread_nolock:
1796 set_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); 1796 set_opt(sb, DIOREAD_NOLOCK);
1797 break; 1797 break;
1798 case Opt_dioread_lock: 1798 case Opt_dioread_lock:
1799 clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); 1799 clear_opt(sb, DIOREAD_NOLOCK);
1800 break; 1800 break;
1801 case Opt_init_inode_table: 1801 case Opt_init_inode_table:
1802 set_opt(sbi->s_mount_opt, INIT_INODE_TABLE); 1802 set_opt(sb, INIT_INODE_TABLE);
1803 if (args[0].from) { 1803 if (args[0].from) {
1804 if (match_int(&args[0], &option)) 1804 if (match_int(&args[0], &option))
1805 return 0; 1805 return 0;
@@ -1810,7 +1810,7 @@ set_qf_format:
1810 sbi->s_li_wait_mult = option; 1810 sbi->s_li_wait_mult = option;
1811 break; 1811 break;
1812 case Opt_noinit_inode_table: 1812 case Opt_noinit_inode_table:
1813 clear_opt(sbi->s_mount_opt, INIT_INODE_TABLE); 1813 clear_opt(sb, INIT_INODE_TABLE);
1814 break; 1814 break;
1815 default: 1815 default:
1816 ext4_msg(sb, KERN_ERR, 1816 ext4_msg(sb, KERN_ERR,
@@ -1822,10 +1822,10 @@ set_qf_format:
1822#ifdef CONFIG_QUOTA 1822#ifdef CONFIG_QUOTA
1823 if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { 1823 if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
1824 if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA]) 1824 if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA])
1825 clear_opt(sbi->s_mount_opt, USRQUOTA); 1825 clear_opt(sb, USRQUOTA);
1826 1826
1827 if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA]) 1827 if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA])
1828 clear_opt(sbi->s_mount_opt, GRPQUOTA); 1828 clear_opt(sb, GRPQUOTA);
1829 1829
1830 if (test_opt(sb, GRPQUOTA) || test_opt(sb, USRQUOTA)) { 1830 if (test_opt(sb, GRPQUOTA) || test_opt(sb, USRQUOTA)) {
1831 ext4_msg(sb, KERN_ERR, "old and new quota " 1831 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 3071
3072 /* Set defaults before we parse the mount options */ 3072 /* Set defaults before we parse the mount options */
3073 def_mount_opts = le32_to_cpu(es->s_default_mount_opts); 3073 def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
3074 set_opt(sbi->s_mount_opt, INIT_INODE_TABLE); 3074 set_opt(sb, INIT_INODE_TABLE);
3075 if (def_mount_opts & EXT4_DEFM_DEBUG) 3075 if (def_mount_opts & EXT4_DEFM_DEBUG)
3076 set_opt(sbi->s_mount_opt, DEBUG); 3076 set_opt(sb, DEBUG);
3077 if (def_mount_opts & EXT4_DEFM_BSDGROUPS) { 3077 if (def_mount_opts & EXT4_DEFM_BSDGROUPS) {
3078 ext4_msg(sb, KERN_WARNING, deprecated_msg, "bsdgroups", 3078 ext4_msg(sb, KERN_WARNING, deprecated_msg, "bsdgroups",
3079 "2.6.38"); 3079 "2.6.38");
3080 set_opt(sbi->s_mount_opt, GRPID); 3080 set_opt(sb, GRPID);
3081 } 3081 }
3082 if (def_mount_opts & EXT4_DEFM_UID16) 3082 if (def_mount_opts & EXT4_DEFM_UID16)
3083 set_opt(sbi->s_mount_opt, NO_UID32); 3083 set_opt(sb, NO_UID32);
3084#ifdef CONFIG_EXT4_FS_XATTR 3084#ifdef CONFIG_EXT4_FS_XATTR
3085 if (def_mount_opts & EXT4_DEFM_XATTR_USER) 3085 if (def_mount_opts & EXT4_DEFM_XATTR_USER)
3086 set_opt(sbi->s_mount_opt, XATTR_USER); 3086 set_opt(sb, XATTR_USER);
3087#endif 3087#endif
3088#ifdef CONFIG_EXT4_FS_POSIX_ACL 3088#ifdef CONFIG_EXT4_FS_POSIX_ACL
3089 if (def_mount_opts & EXT4_DEFM_ACL) 3089 if (def_mount_opts & EXT4_DEFM_ACL)
3090 set_opt(sbi->s_mount_opt, POSIX_ACL); 3090 set_opt(sb, POSIX_ACL);
3091#endif 3091#endif
3092 if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA) 3092 if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA)
3093 set_opt(sbi->s_mount_opt, JOURNAL_DATA); 3093 set_opt(sb, JOURNAL_DATA);
3094 else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED) 3094 else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED)
3095 set_opt(sbi->s_mount_opt, ORDERED_DATA); 3095 set_opt(sb, ORDERED_DATA);
3096 else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK) 3096 else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK)
3097 set_opt(sbi->s_mount_opt, WRITEBACK_DATA); 3097 set_opt(sb, WRITEBACK_DATA);
3098 3098
3099 if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC) 3099 if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC)
3100 set_opt(sbi->s_mount_opt, ERRORS_PANIC); 3100 set_opt(sb, ERRORS_PANIC);
3101 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE) 3101 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE)
3102 set_opt(sbi->s_mount_opt, ERRORS_CONT); 3102 set_opt(sb, ERRORS_CONT);
3103 else 3103 else
3104 set_opt(sbi->s_mount_opt, ERRORS_RO); 3104 set_opt(sb, ERRORS_RO);
3105 if (def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY) 3105 if (def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY)
3106 set_opt(sbi->s_mount_opt, BLOCK_VALIDITY); 3106 set_opt(sb, BLOCK_VALIDITY);
3107 if (def_mount_opts & EXT4_DEFM_DISCARD) 3107 if (def_mount_opts & EXT4_DEFM_DISCARD)
3108 set_opt(sbi->s_mount_opt, DISCARD); 3108 set_opt(sb, DISCARD);
3109 3109
3110 sbi->s_resuid = le16_to_cpu(es->s_def_resuid); 3110 sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
3111 sbi->s_resgid = le16_to_cpu(es->s_def_resgid); 3111 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 sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME; 3114 sbi->s_max_batch_time = EXT4_DEF_MAX_BATCH_TIME;
3115 3115
3116 if ((def_mount_opts & EXT4_DEFM_NOBARRIER) == 0) 3116 if ((def_mount_opts & EXT4_DEFM_NOBARRIER) == 0)
3117 set_opt(sbi->s_mount_opt, BARRIER); 3117 set_opt(sb, BARRIER);
3118 3118
3119 /* 3119 /*
3120 * enable delayed allocation by default 3120 * enable delayed allocation by default
@@ -3122,7 +3122,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3122 */ 3122 */
3123 if (!IS_EXT3_SB(sb) && 3123 if (!IS_EXT3_SB(sb) &&
3124 ((def_mount_opts & EXT4_DEFM_NODELALLOC) == 0)) 3124 ((def_mount_opts & EXT4_DEFM_NODELALLOC) == 0))
3125 set_opt(sbi->s_mount_opt, DELALLOC); 3125 set_opt(sb, DELALLOC);
3126 3126
3127 if (!parse_options((char *) sbi->s_es->s_mount_opts, sb, 3127 if (!parse_options((char *) sbi->s_es->s_mount_opts, sb,
3128 &journal_devnum, &journal_ioprio, NULL, 0)) { 3128 &journal_devnum, &journal_ioprio, NULL, 0)) {
@@ -3425,8 +3425,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3425 "suppressed and not mounted read-only"); 3425 "suppressed and not mounted read-only");
3426 goto failed_mount_wq; 3426 goto failed_mount_wq;
3427 } else { 3427 } else {
3428 clear_opt(sbi->s_mount_opt, DATA_FLAGS); 3428 clear_opt(sb, DATA_FLAGS);
3429 set_opt(sbi->s_mount_opt, WRITEBACK_DATA); 3429 set_opt(sb, WRITEBACK_DATA);
3430 sbi->s_journal = NULL; 3430 sbi->s_journal = NULL;
3431 needs_recovery = 0; 3431 needs_recovery = 0;
3432 goto no_journal; 3432 goto no_journal;
@@ -3464,9 +3464,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3464 */ 3464 */
3465 if (jbd2_journal_check_available_features 3465 if (jbd2_journal_check_available_features
3466 (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) 3466 (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE))
3467 set_opt(sbi->s_mount_opt, ORDERED_DATA); 3467 set_opt(sb, ORDERED_DATA);
3468 else 3468 else
3469 set_opt(sbi->s_mount_opt, JOURNAL_DATA); 3469 set_opt(sb, JOURNAL_DATA);
3470 break; 3470 break;
3471 3471
3472 case EXT4_MOUNT_ORDERED_DATA: 3472 case EXT4_MOUNT_ORDERED_DATA:
@@ -3556,18 +3556,18 @@ no_journal:
3556 (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)) { 3556 (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)) {
3557 ext4_msg(sb, KERN_WARNING, "Ignoring delalloc option - " 3557 ext4_msg(sb, KERN_WARNING, "Ignoring delalloc option - "
3558 "requested data journaling mode"); 3558 "requested data journaling mode");
3559 clear_opt(sbi->s_mount_opt, DELALLOC); 3559 clear_opt(sb, DELALLOC);
3560 } 3560 }
3561 if (test_opt(sb, DIOREAD_NOLOCK)) { 3561 if (test_opt(sb, DIOREAD_NOLOCK)) {
3562 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { 3562 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
3563 ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock " 3563 ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock "
3564 "option - requested data journaling mode"); 3564 "option - requested data journaling mode");
3565 clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); 3565 clear_opt(sb, DIOREAD_NOLOCK);
3566 } 3566 }
3567 if (sb->s_blocksize < PAGE_SIZE) { 3567 if (sb->s_blocksize < PAGE_SIZE) {
3568 ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock " 3568 ext4_msg(sb, KERN_WARNING, "Ignoring dioread_nolock "
3569 "option - block size is too small"); 3569 "option - block size is too small");
3570 clear_opt(sbi->s_mount_opt, DIOREAD_NOLOCK); 3570 clear_opt(sb, DIOREAD_NOLOCK);
3571 } 3571 }
3572 } 3572 }
3573 3573