summaryrefslogtreecommitdiff
path: root/fs/netfs/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2025-07-01 17:38:46 +0100
committerChristian Brauner <brauner@kernel.org>2025-07-01 22:37:14 +0200
commit5e1e6ec2e346c0850f304c31abdef4158007474e (patch)
tree2f31407da4b90fe37338ce1f0fe87c58377edece /fs/netfs/internal.h
parent2e0658940d90a3dc130bb3b7f75bae9f4100e01f (diff)
downloadlinux-next-5e1e6ec2e346c0850f304c31abdef4158007474e.tar.gz
linux-next-5e1e6ec2e346c0850f304c31abdef4158007474e.zip
netfs: Merge i_size update functions
Netfslib has two functions for updating the i_size after a write: one for buffered writes into the pagecache and one for direct/unbuffered writes. However, what needs to be done is much the same in both cases, so merge them together. This does raise one question, though: should updating the i_size after a direct write do the same estimated update of i_blocks as is done for buffered writes. Also get rid of the cleanup function pointer from netfs_io_request as it's only used for direct write to update i_size; instead do the i_size setting directly from write collection. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/20250701163852.2171681-12-dhowells@redhat.com cc: Steve French <sfrench@samba.org> cc: Paulo Alcantara <pc@manguebit.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/netfs/internal.h')
-rw-r--r--fs/netfs/internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h
index d6656d2b54ab..f9bb9464a147 100644
--- a/fs/netfs/internal.h
+++ b/fs/netfs/internal.h
@@ -28,6 +28,12 @@ int netfs_prefetch_for_write(struct file *file, struct folio *folio,
size_t offset, size_t len);
/*
+ * buffered_write.c
+ */
+void netfs_update_i_size(struct netfs_inode *ctx, struct inode *inode,
+ loff_t pos, size_t copied);
+
+/*
* main.c
*/
extern unsigned int netfs_debug;