9p: Use netfslib read/write_iter
authorDavid Howells <dhowells@redhat.com>
Wed, 6 Dec 2023 12:48:56 +0000 (12:48 +0000)
committerDavid Howells <dhowells@redhat.com>
Thu, 28 Dec 2023 09:45:28 +0000 (09:45 +0000)
commit80105ed2fd2715fb09a8fdb0655a8bdc86c120db
tree530a84a43651d519fd39ab8c29cb06de69eeb0e2
parent3560358a49569d0ade0ee5c9cecb3606dac863c2
9p: Use netfslib read/write_iter

Use netfslib's read and write iteration helpers, allowing netfslib to take
over the management of the page cache for 9p files and to manage local disk
caching.  In particular, this eliminates write_begin, write_end, writepage
and all mentions of struct page and struct folio from 9p.

Note that netfslib now offers the possibility of write-through caching if
that is desirable for 9p: just set the NETFS_ICTX_WRITETHROUGH flag in
v9inode->netfs.flags in v9fs_set_netfs_context().

Note also this is untested as I can't get ganesha.nfsd to correctly parse
the config to turn on 9p support.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: Eric Van Hensbergen <ericvh@kernel.org>
cc: Latchesar Ionkov <lucho@ionkov.net>
cc: Dominique Martinet <asmadeus@codewreck.org>
cc: Christian Schoenebeck <linux_oss@crudebyte.com>
cc: v9fs@lists.linux.dev
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
fs/9p/vfs_addr.c
fs/9p/vfs_file.c
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c