[PATCH v2 5/5] ext4: declare support for FOP_DONTCACHE

陈涛涛 Taotao Chen posted 5 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH v2 5/5] ext4: declare support for FOP_DONTCACHE
Posted by 陈涛涛 Taotao Chen 3 months, 2 weeks ago
From: Taotao Chen <chentaotao@didiglobal.com>

Set the FOP_DONTCACHE flag in ext4_file_operations to indicate that
ext4 supports IOCB_DONTCACHE handling in buffered write paths.

Part of a series refactoring address_space_operations write_begin and
write_end callbacks to use struct kiocb for passing write context and
flags.

Signed-off-by: Taotao Chen <chentaotao@didiglobal.com>
---
 fs/ext4/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 21df81347147..274b41a476c8 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -977,7 +977,8 @@ const struct file_operations ext4_file_operations = {
 	.splice_write	= iter_file_splice_write,
 	.fallocate	= ext4_fallocate,
 	.fop_flags	= FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
-			  FOP_DIO_PARALLEL_WRITE,
+			  FOP_DIO_PARALLEL_WRITE |
+			  FOP_DONTCACHE,
 };
 
 const struct inode_operations ext4_file_inode_operations = {
-- 
2.34.1
Re: [PATCH v2 5/5] ext4: declare support for FOP_DONTCACHE
Posted by Theodore Ts'o 3 months, 2 weeks ago
On Tue, Jun 24, 2025 at 12:12:10PM +0000, 陈涛涛 Taotao Chen wrote:
> From: Taotao Chen <chentaotao@didiglobal.com>
> 
> Set the FOP_DONTCACHE flag in ext4_file_operations to indicate that
> ext4 supports IOCB_DONTCACHE handling in buffered write paths.
> 
> Part of a series refactoring address_space_operations write_begin and
> write_end callbacks to use struct kiocb for passing write context and
> flags.
> 
> Signed-off-by: Taotao Chen <chentaotao@didiglobal.com>

I agree that it would be better to combine the ext4 patches.

Acked-by: Theodore Ts'o <tytso@mit.edu>
Re: [PATCH v2 5/5] ext4: declare support for FOP_DONTCACHE
Posted by Matthew Wilcox 3 months, 2 weeks ago
On Tue, Jun 24, 2025 at 12:12:10PM +0000, 陈涛涛 Taotao Chen wrote:
> From: Taotao Chen <chentaotao@didiglobal.com>
> 
> Set the FOP_DONTCACHE flag in ext4_file_operations to indicate that
> ext4 supports IOCB_DONTCACHE handling in buffered write paths.

I think this patch should be combined with the previous patch so we
see all the change needed to support DONTCACHE in one patch.
Re: [PATCH v2 5/5] ext4: declare support for FOP_DONTCACHE
Posted by Chen Taotao 3 months, 2 weeks ago
在 2025/6/24 20:53, Matthew Wilcox 写道:
> On Tue, Jun 24, 2025 at 12:12:10PM +0000, 陈涛涛 Taotao Chen wrote:
>> From: Taotao Chen<chentaotao@didiglobal.com>
>>
>> Set the FOP_DONTCACHE flag in ext4_file_operations to indicate that
>> ext4 supports IOCB_DONTCACHE handling in buffered write paths.
> I think this patch should be combined with the previous patch so we
> see all the change needed to support DONTCACHE in one patch.

I’ll merge the patches to keep the DONTCACHE support self-contained. Thanks!