linux/fs/netfs
David Howells 0e0f2dfe88 netfs: Dispatch write requests to process a writeback slice
Dispatch one or more write reqeusts to process a writeback slice, where a
slice is tailored more to logical block divisions within the file (such as
crypto blocks, an object layout or cache granules) than the protocol RPC
maximum capacity.

The dispatch doesn't happen until throttling allows, at which point the
entire writeback slice is processed and queued.  A slice may be written to
multiple destinations (one or more servers and the local cache) and the
writes to each destination might be split up along different lines.

The writeback slice holds the required folios pinned.  An iov_iter is
provided in netfs_write_request that describes the buffer to be used.  This
may be part of the pagecache, may have auxiliary padding pages attached or
may be a bounce buffer resulting from crypto or compression.  Consequently,
the filesystem must not twiddle the folio markings directly.

The following API is available to the filesystem:

 (1) The ->create_write_requests() method is called to ask the filesystem
     to create the requests it needs.  This is passed the writeback slice
     to be processed.

 (2) The filesystem should then call netfs_create_write_request() to create
     the requests it needs.

 (3) Once a request is initialised, netfs_queue_write_request() can be
     called to dispatch it asynchronously, if not completed immediately.

 (4) netfs_write_request_completed() should be called to note the
     completion of a request.

 (5) netfs_get_write_request() and netfs_put_write_request() are provided
     to refcount a request.  These take constants from the netfs_wreq_trace
     enum for logging into ftrace.

 (6) The ->free_write_request is method is called to ask the filesystem to
     clean up a request.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
2023-12-28 09:45:22 +00:00
..
buffered_read.c netfs: Make the refcounting of netfs_begin_read() easier to use 2023-12-28 09:45:20 +00:00
fscache_cache.c netfs, fscache: Move fs/fscache/* into fs/netfs/ 2023-12-24 11:36:00 +00:00
fscache_cookie.c netfs, fscache: Move fs/fscache/* into fs/netfs/ 2023-12-24 11:36:00 +00:00
fscache_internal.h netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
fscache_io.c netfs: Move pinning-for-writeback from fscache to netfs 2023-12-24 15:08:49 +00:00
fscache_main.c netfs, fscache: Move /proc/fs/fscache to /proc/fs/netfs and put in a symlink 2023-12-24 15:08:48 +00:00
fscache_proc.c netfs, fscache: Move /proc/fs/fscache to /proc/fs/netfs and put in a symlink 2023-12-24 15:08:48 +00:00
fscache_stats.c netfs, fscache: Move /proc/fs/fscache to /proc/fs/netfs and put in a symlink 2023-12-24 15:08:48 +00:00
fscache_volume.c netfs, fscache: Move fs/fscache/* into fs/netfs/ 2023-12-24 11:36:00 +00:00
internal.h netfs: Dispatch write requests to process a writeback slice 2023-12-28 09:45:22 +00:00
io.c netfs: Make the refcounting of netfs_begin_read() easier to use 2023-12-28 09:45:20 +00:00
iterator.c netfs: Add func to calculate pagecount/size-limited span of an iterator 2023-12-28 09:45:18 +00:00
Kconfig netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
locking.c netfs: Implement unbuffered/DIO vs buffered I/O locking 2023-12-24 15:08:52 +00:00
main.c netfs: Extend the netfs_io_*request structs to handle writes 2023-12-28 09:45:19 +00:00
Makefile netfs: Dispatch write requests to process a writeback slice 2023-12-28 09:45:22 +00:00
misc.c netfs: Prep to use folio->private for write grouping and streaming write 2023-12-28 09:45:21 +00:00
objects.c netfs: Make netfs_put_request() handle a NULL pointer 2023-12-28 09:45:20 +00:00
output.c netfs: Dispatch write requests to process a writeback slice 2023-12-28 09:45:22 +00:00
stats.c netfs: Extend the netfs_io_*request structs to handle writes 2023-12-28 09:45:19 +00:00