cachefiles: extract write routine
authorJeffle Xu <jefflexu@linux.alibaba.com>
Mon, 25 Apr 2022 12:21:23 +0000 (20:21 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 17 May 2022 16:11:17 +0000 (00:11 +0800)
commita06fac1599c179853639491974fd72aefd46d030
tree1c1e4098f68255f8105e6c15ff8e3f49a44a4a01
parent6c459b78d4793afbba6d864c466cc5cd2932459d
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>
fs/cachefiles/internal.h
fs/cachefiles/io.c