summaryrefslogtreecommitdiff
path: root/fs/netfs/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-12 09:06:24 +0100
committerDavid Howells <dhowells@redhat.com>2023-12-28 09:45:27 +0000
commit41d8e7673a7726cba57cb8112d81c89cfb6c3e35 (patch)
tree1ae96a5d0a483df02adc4f4f1af6c209b3fbc25d /fs/netfs/internal.h
parent4a79616cfb27d76947ea37f0336745ef929d56be (diff)
netfs: Implement a write-through caching option
Provide a flag whereby a filesystem may request that cifs_perform_write() perform write-through caching. This involves putting pages directly into writeback rather than dirty and attaching them to a write operation as we go. Further, the writes being made are limited to the byte range being written rather than whole folios being written. This can be used by cifs, for example, to deal with strict byte-range locking. This can't be used with content encryption as that may require expansion of the write RPC beyond the write being made. This doesn't affect writes via mmap - those are written back in the normal way; similarly failed writethrough writes are marked dirty and left to writeback to retry. Another option would be to simply invalidate them, but the contents can be simultaneously accessed by read() and through mmap. 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
Diffstat (limited to 'fs/netfs/internal.h')
-rw-r--r--fs/netfs/internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h
index 2de4f826dbe4..d2d63120ac60 100644
--- a/fs/netfs/internal.h
+++ b/fs/netfs/internal.h
@@ -101,6 +101,9 @@ static inline void netfs_see_request(struct netfs_io_request *rreq,
*/
int netfs_begin_write(struct netfs_io_request *wreq, bool may_wait,
enum netfs_write_trace what);
+struct netfs_io_request *netfs_begin_writethrough(struct kiocb *iocb, size_t len);
+int netfs_advance_writethrough(struct netfs_io_request *wreq, size_t copied, bool to_page_end);
+int netfs_end_writethrough(struct netfs_io_request *wreq, struct kiocb *iocb);
/*
* stats.c