[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <703c48213ec033af5fd270c5338921db9898774c.1709361537.git.ritesh.list@gmail.com>
Date: Sat, 2 Mar 2024 13:12:04 +0530
From: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
To: linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org
Cc: Ojaswin Mujoo <ojaswin@...ux.ibm.com>,
Jan Kara <jack@...e.cz>,
Theodore Ts'o <tytso@....edu>,
Matthew Wilcox <willy@...radead.org>,
"Darrick J . Wong" <djwong@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
John Garry <john.g.garry@...cle.com>,
linux-kernel@...r.kernel.org,
"Ritesh Harjani (IBM)" <ritesh.list@...il.com>
Subject: [RFC 7/8] ext4: Enable FMODE_CAN_ATOMIC_WRITE in open for direct-io
For inodes which has EXT4_INODE_ATOMIC_WRITE flag set, enable
FMODE_CAN_ATOMIC_WRITE mode in ext4 file open method for file opened
with O_DIRECT.
Co-developed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>
---
fs/ext4/file.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 8e309a9a0bd6..800fd79e2738 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -913,6 +913,10 @@ static int ext4_file_open(struct inode *inode, struct file *filp)
return ret;
}
+ if (ext4_test_inode_flag(inode, EXT4_INODE_ATOMIC_WRITE) &&
+ (filp->f_flags & O_DIRECT))
+ filp->f_mode |= FMODE_CAN_ATOMIC_WRITE;
+
filp->f_mode |= FMODE_NOWAIT | FMODE_BUF_RASYNC |
FMODE_DIO_PARALLEL_WRITE;
return dquot_file_open(inode, filp);
--
2.43.0
Powered by blists - more mailing lists