]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
fscache: Implement cache registration
authorDavid Howells <dhowells@redhat.com>
Wed, 20 Oct 2021 14:00:26 +0000 (15:00 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 26 Nov 2021 14:28:51 +0000 (14:28 +0000)
commit50b5690ed9aaa2552be1bbdc36fffff29977e24f
treedcd785602d3f7d2a0035b8a8d79e4be49daa84b8
parent3cc5f373f9ba32135710a887ffc9abbb2257d603
fscache: Implement cache registration

Implement a register of caches and provide functions to manage it.

Two functions are provided for the cache backend to use:

 (1) Acquire a cache cookie:

struct fscache_cache *fscache_acquire_cache(const char *name)

     This gets the cache cookie for a cache of the specified name and moves
     it to the preparation state.  If a nameless cache cookie exists, that
     will be given this name and used.

 (2) Relinquish a cache cookie:

void fscache_relinquish_cache(struct fscache_cache *cache);

     This relinquishes a cache cookie, cleans it and makes it available if
     it's still referenced by a network filesystem.

Note that network filesystems don't deal with cache cookies directly, but
rather go straight to the volume registration.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cachefs@redhat.com
fs/fscache/Makefile
fs/fscache/cache.c [new file with mode: 0644]
fs/fscache/internal.h
fs/fscache/proc.c
include/linux/fscache-cache.h
include/trace/events/fscache.h