netfs: Provide func to copy data to pagecache for buffered write
authorDavid Howells <dhowells@redhat.com>
Thu, 17 Jun 2021 12:09:21 +0000 (13:09 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 28 Dec 2023 09:45:22 +0000 (09:45 +0000)
commitc38f4e96e605f17990e871214e6ea1496bc4e65f
treeef067dcae6e6748d547e3ef66615ca7554fee474
parent0e0f2dfe880fb19e4b15a7ca468623eb0b4ba586
netfs: Provide func to copy data to pagecache for buffered write

Provide a netfs write helper, netfs_perform_write() to buffer data to be
written in the pagecache and mark the modified folios dirty.

It will perform "streaming writes" for folios that aren't currently
resident, if possible, storing data in partially modified folios that are
marked dirty, but not uptodate.  It will also tag pages as belonging to
fs-specific write groups if so directed by the filesystem.

This is derived from generic_perform_write(), but doesn't use
->write_begin() and ->write_end(), having that logic rolled in instead.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
fs/netfs/Makefile
fs/netfs/buffered_read.c
fs/netfs/buffered_write.c [new file with mode: 0644]
fs/netfs/internal.h
fs/netfs/io.c
include/linux/netfs.h
include/trace/events/netfs.h