diff options
author | David Howells <dhowells@redhat.com> | 2023-10-06 18:29:59 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2024-05-01 18:08:21 +0100 |
commit | 3ee1a1fc39819906f04d6c62c180e760cd3a689d (patch) | |
tree | 600906ca1cb97992663a0586456ce73434571653 /fs/netfs/io.c | |
parent | 69c3c023af25edb5433a2db824d3e7cc328f0183 (diff) | |
download | lwn-3ee1a1fc39819906f04d6c62c180e760cd3a689d.tar.gz lwn-3ee1a1fc39819906f04d6c62c180e760cd3a689d.zip |
cifs: Cut over to using netfslib
Make the cifs filesystem use netfslib to handle reading and writing on
behalf of cifs. The changes include:
(1) Various read_iter/write_iter type functions are turned into wrappers
around netfslib API functions or are pointed directly at those
functions:
cifs_file_direct{,_nobrl}_ops switch to use
netfs_unbuffered_read_iter and netfs_unbuffered_write_iter.
Large pieces of code that will be removed are #if'd out and will be removed
in subsequent patches.
[?] Why does cifs mark the page dirty in the destination buffer of a DIO
read? Should that happen automatically? Does netfs need to do that?
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
Diffstat (limited to 'fs/netfs/io.c')
-rw-r--r-- | fs/netfs/io.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 6cfecfcd02e1..c93851b98368 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -213,8 +213,13 @@ static void netfs_rreq_assess_dio(struct netfs_io_request *rreq) unsigned int i; size_t transferred = 0; - for (i = 0; i < rreq->direct_bv_count; i++) + for (i = 0; i < rreq->direct_bv_count; i++) { flush_dcache_page(rreq->direct_bv[i].bv_page); + // TODO: cifs marks pages in the destination buffer + // dirty under some circumstances after a read. Do we + // need to do that too? + set_page_dirty(rreq->direct_bv[i].bv_page); + } list_for_each_entry(subreq, &rreq->subrequests, rreq_link) { if (subreq->error || subreq->transferred == 0) |