xref: /openbmc/linux/fs/9p/cache.h (revision f5029f62)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * V9FS cache definitions.
4  *
5  *  Copyright (C) 2009 by Abhishek Kulkarni <adkulkar@umail.iu.edu>
6  */
7 
8 #ifndef _9P_CACHE_H
9 #define _9P_CACHE_H
10 #define FSCACHE_USE_NEW_IO_API
11 #include <linux/fscache.h>
12 
13 #ifdef CONFIG_9P_FSCACHE
14 
15 extern struct fscache_netfs v9fs_cache_netfs;
16 extern const struct fscache_cookie_def v9fs_cache_session_index_def;
17 extern const struct fscache_cookie_def v9fs_cache_inode_index_def;
18 
19 extern void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses);
20 extern void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses);
21 
22 extern void v9fs_cache_inode_get_cookie(struct inode *inode);
23 extern void v9fs_cache_inode_put_cookie(struct inode *inode);
24 extern void v9fs_cache_inode_flush_cookie(struct inode *inode);
25 extern void v9fs_cache_inode_set_cookie(struct inode *inode, struct file *filp);
26 extern void v9fs_cache_inode_reset_cookie(struct inode *inode);
27 
28 extern int __v9fs_cache_register(void);
29 extern void __v9fs_cache_unregister(void);
30 
31 #else /* CONFIG_9P_FSCACHE */
32 
33 static inline void v9fs_cache_inode_get_cookie(struct inode *inode)
34 {
35 }
36 
37 static inline void v9fs_cache_inode_put_cookie(struct inode *inode)
38 {
39 }
40 
41 static inline void v9fs_cache_inode_set_cookie(struct inode *inode, struct file *file)
42 {
43 }
44 
45 #endif /* CONFIG_9P_FSCACHE */
46 #endif /* _9P_CACHE_H */
47