[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240129115512.1281624-3-dhowells@redhat.com>
Date: Mon, 29 Jan 2024 11:54:36 +0000
From: David Howells <dhowells@...hat.com>
To: Eric Van Hensbergen <ericvh@...nel.org>,
Dominique Martinet <asmadeus@...ewreck.org>,
Latchesar Ionkov <lucho@...kov.net>
Cc: David Howells <dhowells@...hat.com>,
Christian Schoenebeck <linux_oss@...debyte.com>,
Matthew Wilcox <willy@...radead.org>,
Jeff Layton <jlayton@...nel.org>,
Christian Brauner <christian@...uner.io>,
netfs@...ts.linux.dev,
v9fs@...ts.linux.dev,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 2/3] 9p: Make better use of netfslib's writethrough caching
netfslib offers the opportunity to do a form of writethrough caching on the
pagecache, whereby netfs_perform_write() will set up and dispatch writes to
the network as it copies data into the cache, falling back to the ordinary
writeback path for the dirty data if this fails. This is selected if the
user sets O_DSYNC, O_SYNC, RWF_DSYNC or RWF_SYNC or if the filesystem sets
NETFS_ICTX_WRITETHROUGH.
Change v9fs_fid_add_modes() to use this if O_DSYNC is set - and assuming
that CACHE_WRITEBACK is set and V9FS_SYNC is not set.
[?] Does it make sense to add an additional caching mode that uses
write-through for all non-DIO writes?
Signed-off-by: David Howells <dhowells@...hat.com>
cc: Eric Van Hensbergen <ericvh@...nel.org>
cc: Latchesar Ionkov <lucho@...kov.net>
cc: Dominique Martinet <asmadeus@...ewreck.org>
cc: Christian Schoenebeck <linux_oss@...debyte.com>
cc: Jeff Layton <jlayton@...nel.org>
cc: v9fs@...ts.linux.dev
cc: netfs@...ts.linux.dev
cc: linux-fsdevel@...r.kernel.org
---
fs/9p/fid.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/9p/fid.h b/fs/9p/fid.h
index 29281b7c3887..0b25b4c9781d 100644
--- a/fs/9p/fid.h
+++ b/fs/9p/fid.h
@@ -56,8 +56,7 @@ static inline void v9fs_fid_add_modes(struct p9_fid *fid, unsigned int s_flags,
((fid->qid.version == 0) && !(s_flags & V9FS_IGNORE_QV)) ||
(s_flags & V9FS_DIRECT_IO) || (f_flags & O_DIRECT)) {
fid->mode |= P9L_DIRECT; /* no read or write cache */
- } else if ((!(s_cache & CACHE_WRITEBACK)) ||
- (f_flags & O_DSYNC) || (s_flags & V9FS_SYNC)) {
+ } else if ((!(s_cache & CACHE_WRITEBACK)) || (s_flags & V9FS_SYNC)) {
fid->mode |= P9L_NOWRITECACHE;
}
}
Powered by blists - more mailing lists