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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h
index 099349c171ca..1ec3ebb0efcd 100644
--- a/fs/nfs/fscache.h
+++ b/fs/nfs/fscache.h
@@ -91,6 +91,7 @@ extern int __nfs_readpage_from_fscache(struct nfs_open_context *,
91extern int __nfs_readpages_from_fscache(struct nfs_open_context *, 91extern int __nfs_readpages_from_fscache(struct nfs_open_context *,
92 struct inode *, struct address_space *, 92 struct inode *, struct address_space *,
93 struct list_head *, unsigned *); 93 struct list_head *, unsigned *);
94extern void __nfs_readpage_to_fscache(struct inode *, struct page *, int);
94 95
95/* 96/*
96 * wait for a page to complete writing to the cache 97 * wait for a page to complete writing to the cache
@@ -140,6 +141,19 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx,
140 return -ENOBUFS; 141 return -ENOBUFS;
141} 142}
142 143
144/*
145 * Store a page newly fetched from the server in an inode data storage object
146 * in the cache.
147 */
148static inline void nfs_readpage_to_fscache(struct inode *inode,
149 struct page *page,
150 int sync)
151{
152 if (PageFsCache(page))
153 __nfs_readpage_to_fscache(inode, page, sync);
154}
155
156
143#else /* CONFIG_NFS_FSCACHE */ 157#else /* CONFIG_NFS_FSCACHE */
144static inline int nfs_fscache_register(void) { return 0; } 158static inline int nfs_fscache_register(void) { return 0; }
145static inline void nfs_fscache_unregister(void) {} 159static inline void nfs_fscache_unregister(void) {}
@@ -184,6 +198,8 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx,
184{ 198{
185 return -ENOBUFS; 199 return -ENOBUFS;
186} 200}
201static inline void nfs_readpage_to_fscache(struct inode *inode,
202 struct page *page, int sync) {}
187 203
188#endif /* CONFIG_NFS_FSCACHE */ 204#endif /* CONFIG_NFS_FSCACHE */
189#endif /* _NFS_FSCACHE_H */ 205#endif /* _NFS_FSCACHE_H */