aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cachefiles/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2021-11-26 14:29:06 +0000
committerDavid Howells <dhowells@redhat.com>2022-01-07 13:41:46 +0000
commitd1065b0a6fd9397edd3094c56b777d0d8ec1290d (patch)
treebd47a34375758f05e7305a8778301a42d47264f7 /fs/cachefiles/internal.h
parentcachefiles: Implement a function to get/create a directory in the cache (diff)
downloadlinux-dev-d1065b0a6fd9397edd3094c56b777d0d8ec1290d.tar.xz
linux-dev-d1065b0a6fd9397edd3094c56b777d0d8ec1290d.zip
cachefiles: Implement cache registration and withdrawal
Do the following: (1) Fill out cachefiles_daemon_add_cache() so that it sets up the cache directories and registers the cache with cachefiles. (2) Add a function to do the top-level part of cache withdrawal and unregistration. (3) Add a function to sync a cache. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819633175.215744.10857127598041268340.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906935445.143852.15545194974036410029.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967142904.1823006.244055483596047072.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021543872.640689.14370017789605073222.stgit@warthog.procyon.org.uk/ # v4
Diffstat (limited to 'fs/cachefiles/internal.h')
-rw-r--r--fs/cachefiles/internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cachefiles/internal.h b/fs/cachefiles/internal.h
index 48768a3ab105..77e874c2bbe7 100644
--- a/fs/cachefiles/internal.h
+++ b/fs/cachefiles/internal.h
@@ -32,6 +32,8 @@ struct cachefiles_object {
struct cachefiles_cache {
struct fscache_cache *cache; /* Cache cookie */
struct vfsmount *mnt; /* mountpoint holding the cache */
+ struct dentry *store; /* Directory into which live objects go */
+ struct dentry *graveyard; /* directory into which dead objects go */
struct file *cachefilesd; /* manager daemon handle */
const struct cred *cache_cred; /* security override for accessing cache */
struct mutex daemon_mutex; /* command serialisation mutex */
@@ -78,8 +80,10 @@ static inline void cachefiles_state_changed(struct cachefiles_cache *cache)
/*
* cache.c
*/
+extern int cachefiles_add_cache(struct cachefiles_cache *cache);
extern int cachefiles_has_space(struct cachefiles_cache *cache,
unsigned fnr, unsigned bnr);
+extern void cachefiles_withdraw_cache(struct cachefiles_cache *cache);
/*
* daemon.c
@@ -126,6 +130,11 @@ static inline int cachefiles_inject_remove_error(void)
}
/*
+ * interface.c
+ */
+extern const struct fscache_cache_ops cachefiles_cache_ops;
+
+/*
* namei.c
*/
extern struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,