aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/fscache.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/fscache.h')
-rw-r--r--fs/nfs/fscache.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h
index 8b4299a0ad61..e29613a8cbd2 100644
--- a/fs/nfs/fscache.h
+++ b/fs/nfs/fscache.h
@@ -83,6 +83,31 @@ extern void nfs_fscache_zap_inode_cookie(struct inode *);
83extern void nfs_fscache_set_inode_cookie(struct inode *, struct file *); 83extern void nfs_fscache_set_inode_cookie(struct inode *, struct file *);
84extern void nfs_fscache_reset_inode_cookie(struct inode *); 84extern void nfs_fscache_reset_inode_cookie(struct inode *);
85 85
86extern void __nfs_fscache_invalidate_page(struct page *, struct inode *);
87extern int nfs_fscache_release_page(struct page *, gfp_t);
88
89/*
90 * wait for a page to complete writing to the cache
91 */
92static inline void nfs_fscache_wait_on_page_write(struct nfs_inode *nfsi,
93 struct page *page)
94{
95 if (PageFsCache(page))
96 fscache_wait_on_page_write(nfsi->fscache, page);
97}
98
99/*
100 * release the caching state associated with a page if undergoing complete page
101 * invalidation
102 */
103static inline void nfs_fscache_invalidate_page(struct page *page,
104 struct inode *inode)
105{
106 if (PageFsCache(page))
107 __nfs_fscache_invalidate_page(page, inode);
108}
109
110
86#else /* CONFIG_NFS_FSCACHE */ 111#else /* CONFIG_NFS_FSCACHE */
87static inline int nfs_fscache_register(void) { return 0; } 112static inline int nfs_fscache_register(void) { return 0; }
88static inline void nfs_fscache_unregister(void) {} 113static inline void nfs_fscache_unregister(void) {}
@@ -104,5 +129,14 @@ static inline void nfs_fscache_set_inode_cookie(struct inode *inode,
104 struct file *filp) {} 129 struct file *filp) {}
105static inline void nfs_fscache_reset_inode_cookie(struct inode *inode) {} 130static inline void nfs_fscache_reset_inode_cookie(struct inode *inode) {}
106 131
132static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp)
133{
134 return 1; /* True: may release page */
135}
136static inline void nfs_fscache_invalidate_page(struct page *page,
137 struct inode *inode) {}
138static inline void nfs_fscache_wait_on_page_write(struct nfs_inode *nfsi,
139 struct page *page) {}
140
107#endif /* CONFIG_NFS_FSCACHE */ 141#endif /* CONFIG_NFS_FSCACHE */
108#endif /* _NFS_FSCACHE_H */ 142#endif /* _NFS_FSCACHE_H */