2021-11-26 14:32:29 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Makefile for caching in a mounted filesystem
|
|
|
|
#
|
|
|
|
|
|
|
|
cachefiles-y := \
|
2021-10-21 07:59:46 +00:00
|
|
|
cache.o \
|
2021-11-26 15:12:07 +00:00
|
|
|
daemon.o \
|
2021-11-26 14:29:06 +00:00
|
|
|
interface.o \
|
2021-10-21 10:05:53 +00:00
|
|
|
io.o \
|
2021-11-17 15:48:06 +00:00
|
|
|
key.o \
|
2021-11-26 14:59:10 +00:00
|
|
|
main.o \
|
2021-11-18 08:58:08 +00:00
|
|
|
namei.o \
|
2021-10-21 08:55:21 +00:00
|
|
|
security.o \
|
2021-11-17 16:11:07 +00:00
|
|
|
volume.o \
|
|
|
|
xattr.o
|
2021-11-26 14:32:29 +00:00
|
|
|
|
2021-10-21 07:15:26 +00:00
|
|
|
cachefiles-$(CONFIG_CACHEFILES_ERROR_INJECTION) += error_inject.o
|
cachefiles: notify the user daemon when looking up cookie
Fscache/CacheFiles used to serve as a local cache for a remote
networking fs. A new on-demand read mode will be introduced for
CacheFiles, which can boost the scenario where on-demand read semantics
are needed, e.g. container image distribution.
The essential difference between these two modes is seen when a cache
miss occurs: In the original mode, the netfs will fetch the data from
the remote server and then write it to the cache file; in on-demand
read mode, fetching the data and writing it into the cache is delegated
to a user daemon.
As the first step, notify the user daemon when looking up cookie. In
this case, an anonymous fd is sent to the user daemon, through which the
user daemon can write the fetched data to the cache file. Since the user
daemon may move the anonymous fd around, e.g. through dup(), an object
ID uniquely identifying the cache file is also attached.
Also add one advisory flag (FSCACHE_ADV_WANT_CACHE_SIZE) suggesting that
the cache file size shall be retrieved at runtime. This helps the
scenario where one cache file contains multiple netfs files, e.g. for
the purpose of deduplication. In this case, netfs itself has no idea the
size of the cache file, whilst the user daemon should give the hint on
it.
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220509074028.74954-3-jefflexu@linux.alibaba.com
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2022-04-25 12:21:24 +00:00
|
|
|
cachefiles-$(CONFIG_CACHEFILES_ONDEMAND) += ondemand.o
|
2021-10-21 07:15:26 +00:00
|
|
|
|
2021-11-26 14:32:29 +00:00
|
|
|
obj-$(CONFIG_CACHEFILES) := cachefiles.o
|