Skip to content

Commit fc626fe

Browse files
weiny2tytso
authored andcommitted
fs/ext4: Change EXT4_MOUNT_DAX to EXT4_MOUNT_DAX_ALWAYS
In prep for the new tri-state mount option which then introduces EXT4_MOUNT_DAX_NEVER. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20200528150003.828793-4-ira.weiny@intel.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 6c0d077 commit fc626fe

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎fs/ext4/ext4.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,9 +1123,9 @@ struct ext4_inode_info {
11231123
#define EXT4_MOUNT_MINIX_DF 0x00080 /* Mimics the Minix statfs */
11241124
#define EXT4_MOUNT_NOLOAD 0x00100 /* Don't use existing journal*/
11251125
#ifdef CONFIG_FS_DAX
1126-
#define EXT4_MOUNT_DAX 0x00200 /* Direct Access */
1126+
#define EXT4_MOUNT_DAX_ALWAYS 0x00200 /* Direct Access */
11271127
#else
1128-
#define EXT4_MOUNT_DAX 0
1128+
#define EXT4_MOUNT_DAX_ALWAYS 0
11291129
#endif
11301130
#define EXT4_MOUNT_DATA_FLAGS 0x00C00 /* Mode for data writes: */
11311131
#define EXT4_MOUNT_JOURNAL_DATA 0x00400 /* Write data to journal */

‎fs/ext4/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4400,7 +4400,7 @@ int ext4_get_inode_loc(struct inode *inode, struct ext4_iloc *iloc)
44004400

44014401
static bool ext4_should_use_dax(struct inode *inode)
44024402
{
4403-
if (!test_opt(inode->i_sb, DAX))
4403+
if (!test_opt(inode->i_sb, DAX_ALWAYS))
44044404
return false;
44054405
if (!S_ISREG(inode->i_mode))
44064406
return false;

‎fs/ext4/super.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ static const struct mount_opts {
17751775
{Opt_min_batch_time, 0, MOPT_GTE0},
17761776
{Opt_inode_readahead_blks, 0, MOPT_GTE0},
17771777
{Opt_init_itable, 0, MOPT_GTE0},
1778-
{Opt_dax, EXT4_MOUNT_DAX, MOPT_SET},
1778+
{Opt_dax, EXT4_MOUNT_DAX_ALWAYS, MOPT_SET},
17791779
{Opt_stripe, 0, MOPT_GTE0},
17801780
{Opt_resuid, 0, MOPT_GTE0},
17811781
{Opt_resgid, 0, MOPT_GTE0},
@@ -3982,7 +3982,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
39823982
"both data=journal and dioread_nolock");
39833983
goto failed_mount;
39843984
}
3985-
if (test_opt(sb, DAX)) {
3985+
if (test_opt(sb, DAX_ALWAYS)) {
39863986
ext4_msg(sb, KERN_ERR, "can't mount with "
39873987
"both data=journal and dax");
39883988
goto failed_mount;
@@ -4092,7 +4092,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
40924092
goto failed_mount;
40934093
}
40944094

4095-
if (sbi->s_mount_opt & EXT4_MOUNT_DAX) {
4095+
if (sbi->s_mount_opt & EXT4_MOUNT_DAX_ALWAYS) {
40964096
if (ext4_has_feature_inline_data(sb)) {
40974097
ext4_msg(sb, KERN_ERR, "Cannot use DAX on a filesystem"
40984098
" that may contain inline data");
@@ -5412,7 +5412,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
54125412
err = -EINVAL;
54135413
goto restore_opts;
54145414
}
5415-
if (test_opt(sb, DAX)) {
5415+
if (test_opt(sb, DAX_ALWAYS)) {
54165416
ext4_msg(sb, KERN_ERR, "can't mount with "
54175417
"both data=journal and dax");
54185418
err = -EINVAL;
@@ -5433,10 +5433,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
54335433
goto restore_opts;
54345434
}
54355435

5436-
if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT4_MOUNT_DAX) {
5436+
if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT4_MOUNT_DAX_ALWAYS) {
54375437
ext4_msg(sb, KERN_WARNING, "warning: refusing change of "
54385438
"dax flag with busy inodes while remounting");
5439-
sbi->s_mount_opt ^= EXT4_MOUNT_DAX;
5439+
sbi->s_mount_opt ^= EXT4_MOUNT_DAX_ALWAYS;
54405440
}
54415441

54425442
if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)

0 commit comments

Comments
 (0)