1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Ceph cache definitions.
5 * Copyright (C) 2013 by Adfin Solutions, Inc. All Rights Reserved.
6 * Written by Milosz Tanski (milosz@adfin.com)
12 #ifdef CONFIG_CEPH_FSCACHE
14 extern struct fscache_netfs ceph_cache_netfs;
16 int ceph_fscache_register(void);
17 void ceph_fscache_unregister(void);
19 int ceph_fscache_register_fs(struct ceph_fs_client* fsc, struct fs_context *fc);
20 void ceph_fscache_unregister_fs(struct ceph_fs_client* fsc);
22 void ceph_fscache_register_inode_cookie(struct inode *inode);
23 void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info* ci);
24 void ceph_fscache_file_set_cookie(struct inode *inode, struct file *filp);
25 void ceph_fscache_revalidate_cookie(struct ceph_inode_info *ci);
27 int ceph_readpage_from_fscache(struct inode *inode, struct page *page);
28 int ceph_readpages_from_fscache(struct inode *inode,
29 struct address_space *mapping,
30 struct list_head *pages,
33 static inline void ceph_fscache_inode_init(struct ceph_inode_info *ci)
38 static inline void ceph_fscache_invalidate(struct inode *inode)
40 fscache_invalidate(ceph_inode(inode)->fscache);
45 static inline int ceph_fscache_register(void)
50 static inline void ceph_fscache_unregister(void)
54 static inline int ceph_fscache_register_fs(struct ceph_fs_client* fsc,
55 struct fs_context *fc)
60 static inline void ceph_fscache_unregister_fs(struct ceph_fs_client* fsc)
64 static inline void ceph_fscache_inode_init(struct ceph_inode_info *ci)
68 static inline void ceph_fscache_register_inode_cookie(struct inode *inode)
72 static inline void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info* ci)
76 static inline void ceph_fscache_file_set_cookie(struct inode *inode,
81 static inline void ceph_fscache_invalidate(struct inode *inode)
87 #endif /* _CEPH_CACHE_H */