ceph: rip out old fscache readpage handling
[linux-2.6-microblaze.git] / fs / ceph / cache.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Ceph cache definitions.
4  *
5  *  Copyright (C) 2013 by Adfin Solutions, Inc. All Rights Reserved.
6  *  Written by Milosz Tanski (milosz@adfin.com)
7  */
8
9 #ifndef _CEPH_CACHE_H
10 #define _CEPH_CACHE_H
11
12 #ifdef CONFIG_CEPH_FSCACHE
13
14 extern struct fscache_netfs ceph_cache_netfs;
15
16 int ceph_fscache_register(void);
17 void ceph_fscache_unregister(void);
18
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);
21
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);
26
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,
31                                 unsigned *nr_pages);
32
33 static inline void ceph_fscache_inode_init(struct ceph_inode_info *ci)
34 {
35         ci->fscache = NULL;
36 }
37
38 static inline void ceph_fscache_invalidate(struct inode *inode)
39 {
40         fscache_invalidate(ceph_inode(inode)->fscache);
41 }
42
43 #else
44
45 static inline int ceph_fscache_register(void)
46 {
47         return 0;
48 }
49
50 static inline void ceph_fscache_unregister(void)
51 {
52 }
53
54 static inline int ceph_fscache_register_fs(struct ceph_fs_client* fsc,
55                                            struct fs_context *fc)
56 {
57         return 0;
58 }
59
60 static inline void ceph_fscache_unregister_fs(struct ceph_fs_client* fsc)
61 {
62 }
63
64 static inline void ceph_fscache_inode_init(struct ceph_inode_info *ci)
65 {
66 }
67
68 static inline void ceph_fscache_register_inode_cookie(struct inode *inode)
69 {
70 }
71
72 static inline void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info* ci)
73 {
74 }
75
76 static inline void ceph_fscache_file_set_cookie(struct inode *inode,
77                                                 struct file *filp)
78 {
79 }
80
81 static inline void ceph_fscache_invalidate(struct inode *inode)
82 {
83 }
84
85 #endif
86
87 #endif /* _CEPH_CACHE_H */