diff options
Diffstat (limited to 'fs/nfs/fscache.h')
-rw-r--r-- | fs/nfs/fscache.h | 34 |
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 *); | |||
83 | extern void nfs_fscache_set_inode_cookie(struct inode *, struct file *); | 83 | extern void nfs_fscache_set_inode_cookie(struct inode *, struct file *); |
84 | extern void nfs_fscache_reset_inode_cookie(struct inode *); | 84 | extern void nfs_fscache_reset_inode_cookie(struct inode *); |
85 | 85 | ||
86 | extern void __nfs_fscache_invalidate_page(struct page *, struct inode *); | ||
87 | extern int nfs_fscache_release_page(struct page *, gfp_t); | ||
88 | |||
89 | /* | ||
90 | * wait for a page to complete writing to the cache | ||
91 | */ | ||
92 | static 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 | */ | ||
103 | static 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 */ |
87 | static inline int nfs_fscache_register(void) { return 0; } | 112 | static inline int nfs_fscache_register(void) { return 0; } |
88 | static inline void nfs_fscache_unregister(void) {} | 113 | static 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) {} |
105 | static inline void nfs_fscache_reset_inode_cookie(struct inode *inode) {} | 130 | static inline void nfs_fscache_reset_inode_cookie(struct inode *inode) {} |
106 | 131 | ||
132 | static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp) | ||
133 | { | ||
134 | return 1; /* True: may release page */ | ||
135 | } | ||
136 | static inline void nfs_fscache_invalidate_page(struct page *page, | ||
137 | struct inode *inode) {} | ||
138 | static 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 */ |