diff options
Diffstat (limited to 'include/linux/fscache.h')
-rw-r--r-- | include/linux/fscache.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 7c4d72f5581f..9ec20dec3353 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
@@ -204,6 +204,8 @@ extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); | |||
204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); | 204 | extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); |
205 | extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, | 205 | extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, |
206 | gfp_t); | 206 | gfp_t); |
207 | extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *, | ||
208 | struct inode *); | ||
207 | 209 | ||
208 | /** | 210 | /** |
209 | * fscache_register_netfs - Register a filesystem as desiring caching services | 211 | * fscache_register_netfs - Register a filesystem as desiring caching services |
@@ -643,4 +645,23 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie, | |||
643 | return false; | 645 | return false; |
644 | } | 646 | } |
645 | 647 | ||
648 | /** | ||
649 | * fscache_uncache_all_inode_pages - Uncache all an inode's pages | ||
650 | * @cookie: The cookie representing the inode's cache object. | ||
651 | * @inode: The inode to uncache pages from. | ||
652 | * | ||
653 | * Uncache all the pages in an inode that are marked PG_fscache, assuming them | ||
654 | * to be associated with the given cookie. | ||
655 | * | ||
656 | * This function may sleep. It will wait for pages that are being written out | ||
657 | * and will wait whilst the PG_fscache mark is removed by the cache. | ||
658 | */ | ||
659 | static inline | ||
660 | void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie, | ||
661 | struct inode *inode) | ||
662 | { | ||
663 | if (fscache_cookie_valid(cookie)) | ||
664 | __fscache_uncache_all_inode_pages(cookie, inode); | ||
665 | } | ||
666 | |||
646 | #endif /* _LINUX_FSCACHE_H */ | 667 | #endif /* _LINUX_FSCACHE_H */ |