]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
netfs: Define an interface to talk to a cache
authorDavid Howells <dhowells@redhat.com>
Thu, 6 Feb 2020 14:22:24 +0000 (14:22 +0000)
committerDavid Howells <dhowells@redhat.com>
Wed, 27 Jan 2021 23:12:03 +0000 (23:12 +0000)
commit99fed40841c46296511363fac3f548787a1612d4
tree17b2d8c11beb3250ad24c456851c6c2c5df962ae
parent1cd11ccf1530dfd235662ddae0c8390e643ea44a
netfs: Define an interface to talk to a cache

Add an interface to the netfs helper library for reading data from the
cache instead of downloading it from the server and support for writing
data just downloaded or cleared to the cache.

The API passes an iov_iter to the cache read/write routines to indicate the
data/buffer to be used.  This is done using the ITER_XARRAY type to provide
direct access to the netfs inode's pagecache.

When the netfs's ->begin_cache_operation() method is called, this must fill
in the cache_resources in the netfs_read_request struct, including the
netfs_cache_ops used by the helper lib to talk to the cache.  The helper
lib does not directly access the cache.

Signed-off-by: David Howells <dhowells@redhat.com>
fs/netfs/read_helper.c
fs/netfs/stats.c
include/linux/fscache-cache.h
include/linux/fscache.h
include/linux/netfs.h