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;
} }
......
This diff is collapsed.
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