diff options
author | Jeffle Xu | 2022-04-25 20:21:23 +0800 |
---|---|---|
committer | Gao Xiang | 2022-05-18 00:11:17 +0800 |
commit | a06fac1599c179853639491974fd72aefd46d030 (patch) | |
tree | 1c1e4098f68255f8105e6c15ff8e3f49a44a4a01 /fs/cachefiles/internal.h | |
parent | 6c459b78d4793afbba6d864c466cc5cd2932459d (diff) |
cachefiles: extract write routine
Extract the generic routine of writing data to cache files, and make it
generally available.
This will be used by the following patch implementing on-demand read
mode. Since it's called inside CacheFiles module, make the interface
generic and unrelated to netfs_cache_resources.
It is worth noting that, ki->inval_counter is not initialized after
this cleanup. It shall not make any visible difference, since
inval_counter is no longer used in the write completion routine, i.e.
cachefiles_write_complete().
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Acked-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20220425122143.56815-2-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/cachefiles/internal.h')
-rw-r--r-- | fs/cachefiles/internal.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h index c793d33b0224..e80673d0ab97 100644 --- a/fs/cachefiles/internal.h +++ b/fs/cachefiles/internal.h @@ -201,6 +201,16 @@ extern void cachefiles_put_object(struct cachefiles_object *object, */ extern bool cachefiles_begin_operation(struct netfs_cache_resources *cres, enum fscache_want_state want_state); +extern int __cachefiles_prepare_write(struct cachefiles_object *object, + struct file *file, + loff_t *_start, size_t *_len, + bool no_space_allocated_yet); +extern int __cachefiles_write(struct cachefiles_object *object, + struct file *file, + loff_t start_pos, + struct iov_iter *iter, + netfs_io_terminated_t term_func, + void *term_func_priv); /* * key.c |