diff options
Diffstat (limited to 'include/linux/fscache.h')
-rw-r--r-- | include/linux/fscache.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index ec0dad5ab90f..9ec20dec3353 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
@@ -102,9 +102,9 @@ struct fscache_cookie_def { | |||
102 | */ | 102 | */ |
103 | void (*get_attr)(const void *cookie_netfs_data, uint64_t *size); | 103 | void (*get_attr)(const void *cookie_netfs_data, uint64_t *size); |
104 | 104 | ||
105 | /* get the auxilliary data from netfs data | 105 | /* get the auxiliary data from netfs data |
106 | * - this function can be absent if the index carries no state data | 106 | * - this function can be absent if the index carries no state data |
107 | * - should store the auxilliary data in the buffer | 107 | * - should store the auxiliary data in the buffer |
108 | * - should return the amount of amount stored | 108 | * - should return the amount of amount stored |
109 | * - not permitted to return an error | 109 | * - not permitted to return an error |
110 | * - the netfs data from the cookie being used as the source is | 110 | * - the netfs data from the cookie being used as the source is |
@@ -117,7 +117,7 @@ struct fscache_cookie_def { | |||
117 | /* consult the netfs about the state of an object | 117 | /* consult the netfs about the state of an object |
118 | * - this function can be absent if the index carries no state data | 118 | * - this function can be absent if the index carries no state data |
119 | * - the netfs data from the cookie being used as the target is | 119 | * - the netfs data from the cookie being used as the target is |
120 | * presented, as is the auxilliary data | 120 | * presented, as is the auxiliary data |
121 | */ | 121 | */ |
122 | enum fscache_checkaux (*check_aux)(void *cookie_netfs_data, | 122 | enum fscache_checkaux (*check_aux)(void *cookie_netfs_data, |
123 | const void *data, | 123 | const void *data, |
@@ -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 */ |