linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
@ 2023-06-12  5:35 Christoph Hellwig
  2023-06-13  6:59 ` Damien Le Moal
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2023-06-12  5:35 UTC (permalink / raw)
  To: dlemoal, naohiro.aota; +Cc: jth, linux-fsdevel

Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file
systems can just set the FMODE_CAN_ODIRECT flag at open time instead of
wiring up a dummy direct_IO method to indicate support for direct I/O.
Do that for zonefs so that noop_direct_IO can eventually be removed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/zonefs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/zonefs/file.c b/fs/zonefs/file.c
index 132f01d3461f14..12372ec58389e1 100644
--- a/fs/zonefs/file.c
+++ b/fs/zonefs/file.c
@@ -181,7 +181,6 @@ const struct address_space_operations zonefs_file_aops = {
 	.migrate_folio		= filemap_migrate_folio,
 	.is_partially_uptodate	= iomap_is_partially_uptodate,
 	.error_remove_page	= generic_error_remove_page,
-	.direct_IO		= noop_direct_IO,
 	.swap_activate		= zonefs_swap_activate,
 };
 
@@ -813,6 +812,7 @@ static int zonefs_file_open(struct inode *inode, struct file *file)
 {
 	int ret;
 
+	file->f_mode |= FMODE_CAN_ODIRECT;
 	ret = generic_file_open(inode, file);
 	if (ret)
 		return ret;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method
  2023-06-12  5:35 [PATCH] zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Christoph Hellwig
@ 2023-06-13  6:59 ` Damien Le Moal
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Le Moal @ 2023-06-13  6:59 UTC (permalink / raw)
  To: Christoph Hellwig, naohiro.aota; +Cc: jth, linux-fsdevel

On 6/12/23 14:35, Christoph Hellwig wrote:
> Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file
> systems can just set the FMODE_CAN_ODIRECT flag at open time instead of
> wiring up a dummy direct_IO method to indicate support for direct I/O.
> Do that for zonefs so that noop_direct_IO can eventually be removed.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Applied to for-6.5. Thanks !


-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-13  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12  5:35 [PATCH] zonefs: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method Christoph Hellwig
2023-06-13  6:59 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).